Returns all rows as associative array.
@param  string
@param  string $value name used for an array value or NULL for the whole row
@return array
321472
public function fetchPairs($key, $value = NULL) {
		$return = array();
		foreach ($this as $row) {
			$return[$row->$key] = $value ? $row->$value : $row->$key;
		}
		return $return;
	}
634419
protected function castToArray($value, bool $nullable = true)
    {
        if (null === $value) {
            return $nullable ? null : [];
        }

        if (!\is_array($value)) {
            return '' === $value ? [] : [$value];
        }

        return $value;
    }
106586
public static function stringToArray($value)
    {
        $value = strtoupper($value);
        $newValue = [];
        foreach (explode(';', $value) as $part) {
            // Skipping empty parts.
            if (empty($part)) {
                continue;
            }
            list($partName, $partValue) = explode('=', $part);

            // The value itself had multiple values..
            if (false !== strpos($partValue, ',')) {
                $partValue = explode(',', $partValue);
            }
            $newValue[$partName] = $partValue;
        }

        return $newValue;
    }
903643
public function toArray($value)
    {
        if (empty($value)) {
            return null;
        }

        $output = [];
        /** @var Model\ModelInterface $model */
        foreach ($value as $model) {
            $output[] = $model->toArray();
        }

        return $output;
    }
312056
public function loadAssocList()
    {
        if ($this->stmt === null) {
            return null;
        }

        $assocList = array();
        while ($row = $this->stmt->fetch(\PDO::FETCH_ASSOC)) {
            $assocList[] = $row;
        }
        return $assocList;
    }
123688
public function findAll($value): ?array
    {
        $founded = array_keys($this->items->toArray(), $value, true);

        if (0 === count($founded)) {
            return null;
        }

        return $founded;
    }
767069
public function serialize($value)
    {
        if ($value instanceof AnDomainAttributeInterface) {
            $value = $value->serialize();
        }

        return array((string) $this->_column => $value);
    }
1104365
public function filter($value)
    {
        if (null === $value) {
            return null;
        }
        $this->checkValueIsArrayOrThrowException($value);

        $return = [];
        foreach ($value as $header => $condition) {
            $return[$header] = $this->conditionFilter->filter($condition);
        }

        return $return;
    }
1177991
private static function getListFromString($value)
    {
        if (is_string($value_array = $value)) {
            $value = str_replace([',', ' '], ';', $value);
            $value_array = explode(';', $value);
        }

        if (is_array($value_array)) {
            return array_filter(array_map('trim', $value_array));
        }

        return [];
    }
710479
protected function splitQueryValue($value)
    {
        $data = explode('=', $value, 2);
        if (1 === count($data)) {
            $data[] = null;
        }
        return $data;
    }
398883
protected function _splitQueryValue($value)
    {
        $data = explode('=', $value, 2);
        if (1 === count($data)) {
            $data[] = null;
        }
        return $data;
    }
1053989
public function convertJsonToArray($value) {

		if(true === $this -> convert_json) {

			if(true === is_string($value)) {

				$tmp = @json_decode($value, true);

				if(true === (json_last_error() == JSON_ERROR_NONE)) {
					$value = $tmp;
				}
			}
		}

		return $value;
	}
983659
public function serialize($value) {
        $filters = $this->getFilters();
        for ($i = count($filters) - 1; $i >= 0; --$i) {
            $value = $filters[$i]->fromValue($value);
        }
        return $this->toData($value);
    }
1305673
public function getNodeByValue($value): ?Node {
        /**
         * @var string $arrayIndex
         * @var SinglyLinkedList $list
         */
        foreach ($this->bucket as $arrayIndex => $list) {
            /*
             * $list is the first element in the bucket. The bucket
             * can contain max $maxSize entries and each entry has zero
             * or one nodes which can have zero, one or multiple
             * successors.
             *
             */
            if (!$list->containsValue($value)) {
                continue;
            }
            $node = $list->getNodeByValue($value);
            return $node;
        }
        //return null if there is no value
        return null;
    }
5362
public function fetchColumns($key = null, $value = null)
    {
        $this->rewind();

        $result = array();

        if ($key instanceof Database\Definition\Column) {
            $key = $key->schemaName;
        }

        if ($value instanceof Database\Definition\Column) {
            $value = $value->schemaName;
        }

        if (null === $key || null === $value) {
            $r = $this->driver->fetchAssoc($this->result);
            $keys = array_keys($r);
            if (null === $key) {
                $key = $keys[0];
            }
            if (null === $value) {
                $value = $keys[1];
            }
            $result [$r[$key]] = $r[$value];
        }

        while ($r = $this->driver->fetchAssoc($this->result)) {
            $result [$r[$key]] = $r[$value];
        }
        return $result;
    }
959708
protected function extractArray($value)
    {
        if (empty($value)) {
            return [];
        }

        if ($value instanceof \Traversable) {
            $array = [];
            foreach ($value as $key => $value) {
                $array[$key] = $value;
            }
            return $array;
        }

        return (Array) $value;
    }
957480
protected function valueToJsonLd($value)
    {
        if (is_array($value)) {
            $return = [];
            foreach ($value as $item) {
                $return[] = $this->valueToJsonLd($item);
            }

            return $return;
        } elseif ($value instanceof Type\EnumerationType || $value instanceof Type\Enumeration) {
            return $value->getSchemaUrl();
        } elseif ($value instanceof Type\TypeInterface) {
            return $this->typeToJsonLd($value);
        } elseif ($value instanceof Property\PropertyInterface) {
            return $this->propertyToJsonLd($value);
        } elseif ($value instanceof DataType\DataTypeInterface) {
            return $this->dataTypeToJsonLd($value);
        }

        throw new \Exception('Unexpected data type '.gettype($value));
    }