@deprecated use fetchAll($keyField, $valueField)

@param null $key
@param null $value
@return array
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;
    }
238300
function get_by($field, $value)
	{
		$q = \Fw\Db::prepare("select * from " . $this->_table . " where " . $field . "=?");
		$q->execute(array($value));
		return $q->fetchAll(\PDO::FETCH_CLASS, $this->_entity);
	}
534337
protected function checkValue($value, $key = null)
    {
        if ($value != null) {
            if ($key !== null) {
                return isset($value[$key]) ? $value[$key] : null;
            }

            return $value;
        }
    }
1050958
protected function getFieldValue(string $field, string $value): array
    {
        return [
            'type' => $this->searchFields[$field]['type'],
            'operator' => key($this->searchFields[$field]['operators']),
            'value' => $value
        ];
    }
1105218
public function SelectKeyValue( $Key , $Value ) {

        $Key = new Expression( $Key );
        $Value = new Expression( $Value );

        $items = array();

        foreach ( $this->repository as $item ) {
            $_k = $Key->execute( $item );
            $_v = $Value->execute( $item );
            $items[$_k] = $_v;
        }

        return new Queryable( $items );

    }
276456
public function query($key, $value = null)
    {
        if ($value) {
            return $this->replicate(['query' => [$key => $value]]);
        }

        return $this->replicate(['query' => $key]);
    }
158373
public static function fetch($values, $key)
    {
        /** @var array $segments */
        $segments = explode(static::PATH_DELIMITER, $key);
        $results  = [];

        foreach ($segments as $segment) {
            $results = [];

            foreach ($values as $value) {
                $value     = (array) $value;
                $results[] = $value[$segment];
            }

            $values = array_values($results);
        }

        return array_values($results);
    }
1166852
public static function get($key, $value = null)
    {
        if (self::check($key, !is_null($value))) {
            return self::reach($key, $value);
        }

        static::set($key, $value);

        return $value;
    }
1301469
final public function fetchColumns($column, $key, $value)
    {
        $this->validateShortcutData();

        return $this->db->select($column)
                        ->from(static::getTableName())
                        ->whereEquals($key, $value)
                        ->queryAll($column);
    }
990015
public static function model($model, $value, $key = 'id')
    {
        if (! $model instanceof Builder) {
            $model = $model::query();
        }

        return $model->get()->map(function ($model) use ($value, $key) {
            return [
                'value' => $model->{$key},
                'label' => $model->{$value},
            ];
        });
    }
977343
protected function cache($key, $value = null)
    {
        if (is_null($value) && $this->cacheHas($key)) {
            array_forget($this->cache, $key);
            return null;
        }

        if (is_null($value)) {
            return array_get($this->cache, $key, false);
        }

        if (! is_bool($value)) {
            $value  =   false;
        }

        array_set($this->cache, $key, $value);

        return $value;
    }
525370
final public function queryArrayKey(string $query, string $keyField, string $keyPrefix = '')
    {
        $result = $this->queryResult($query);
        if (false === $result) {
            return false;
        }

        $return = [];
        while ($row = $result->fetchRow()) {
            if (! array_key_exists($keyField, $row)) {
                return false;
            }
            $return[$keyPrefix . $row[$keyField]] = $row;
        }
        return $return;
    }
1227199
public function asArray($key = null, $value = null)
    {
        if (!is_null($key))
        {
            Helpers\Validate::table($this->name)->field($key);
        }
        if (!is_null($value))
        {
            Helpers\Validate::table($this->name)->field($value);
        }

        $datas = array();
        if (!$this->resetKeys)
        {
            if (is_null($key) && is_null($value))
            {
                return $this->data;
            }
            else
            {
                foreach ($this->data as $rowKey => $data)
                {
                    $datas[$rowKey] = array();
                    foreach ($data as $row)
                    {
                        if (is_null($key))
                        {
                            $datas[$rowKey][] = $row->{$value};
                        }
                        elseif (is_null($value))
                        {
                            $datas[$rowKey][$row->{$key}] = $row;
                        }
                        else
                        {
                            $datas[$rowKey][$row->{$key}] = $row->{$value};
                        }
                    }
                }
            }
        }
        else
        {
            if (is_null($key) && is_null($value))
            {
                foreach ($this->data as $data)
                {
                    $datas[] = get_object_vars($data);
                }
            }
            else
            {
                foreach ($this->data as $data)
                {
                    if (is_null($key))
                    {
                        $datas[] = $data->{$value};
                    }
                    elseif (is_null($value))
                    {
                        $datas[$data->{$key}] = $data;
                    }
                    else
                    {
                        $datas[$data->{$key}] = $data->{$value};
                    }
                }
            }
        }

        return $datas;
    }
1365736
public function bind($key, $value = null)
    {
        if (is_array($key))
        {
            foreach ($key as $name => $value)
            {
                $this->_bound[$name] = $value;
            }
        }
        else
        {
            $this->_bound[$key] = $value;
        }

        return $this;
    }
13682
public function fetch($key, $value)
	{
		foreach ($this->_data as $data)
		{
			if ($data->get($key) == $value)
			{
				return $data;
			}
		}
		return null;
	}
70658
public static function extract($collection, $value, $key = null, $default = null)
    {
        $results = [];

        [$value, $key] = static::extractKeyValueParameters($value, $key);

        foreach ($collection as $item) {
            $itemValue = static::walk($item, $value, $default);

            if (is_null($key)) {
                $results[] = $itemValue;
            } else {
                $itemKey = static::walk($item, $key, $default);

                $results[$itemKey] = $itemValue;
            }
        }

        return $results;
    }
609075
public static function keys($value)
    {

        if (is_array($value)) {
            return array_keys($value);
        }

        if (!is_object($value)) {
            return [];
        }

        if (!$value instanceof Traversable) {
            return array_keys(get_object_vars($value));
        }

        return array_keys(iterator_to_array($value, true));

    }