@param $keyColumn
@param $valueColumn

@return mixed
437939
public static function listBy($keyColumn, $valueColumn)
    {
        $valueColumnKey = explode('.', $valueColumn)[0];

        return static::get([$keyColumn, $valueColumnKey])->keyBy($keyColumn)->map(function ($item, $keyColumn) use ($valueColumn) {
            return array_get($item->toArray(), $valueColumn);
        });
    }
182669
public function _delete(...$keyValues) {
		$instance = DAO::getOne ( $this->model, $keyValues, false );
		$this->operate_ ( $instance, function ($instance) {
			return DAO::remove ( $instance );
		}, "deleted", "Unable to delete the instance", $keyValues );
	}
413251
public function getColumnValues($columnName = 'PrimaryKey')
    {
        $ret = [];
        $keyGetterMethod = 'get' . ucfirst($columnName);
        foreach ($this as $obj) {
            $ret[] = $obj->$keyGetterMethod();
        }

        return $ret;
    }
363411
public function fetchArray($keyField = null, $valueField = null)
    {
        $result = [];
        if ($keyField === null) {
            foreach ($this as $row) {
                $result[] = $row;
            }
        } elseif ($valueField === null) {
            foreach ($this as $row) {
                $key = $row[$keyField];
                unset($row[$keyField]); // no need to store key in values array
                $result[$key] = $row;
            }
        } else {
            foreach ($this as $row) {
                $result[$row[$keyField]] = $row[$valueField];
            }
        }

        return $result;
    }
150056
public function getValueIfExist($queries, $keyString)
    {
        foreach ($queries as $query) {
            if ($query->Variable_name == $keyString) {
                return $query->Value;
            }
        }
    }
1120106
protected function update($keyValue=null, String $key, String $table, Array $properties=[])
	{
		if (isset($properties[$key])) {
			unset($properties[$key]);
		}

		$this->queryBuilder()->where(
			$key, $keyValue
		)->update($table, $properties);

	}
673686
public final function findPairs($keyName, $valueName)
    {
        //inicjalizacja pustej tablicy
        $kv = [];
        //iteracja po danych
        foreach (DbConnector::getAdapter()->select(DbConnector::getAdapter()->prepareField($keyName) . ', ' . DbConnector::getAdapter()->prepareField($valueName), $this->_prepareFrom(), $this->_query->getQueryCompile()->where, $this->_query->getQueryCompile()->groupBy, $this->_query->getQueryCompile()->order, $this->_query->getQueryCompile()->limit, $this->_query->getQueryCompile()->offset, $this->_query->getQueryCompile()->bind) as $row) {
            //przy wybieraniu tych samych pól tabela ma tylko jeden wiersz
            $row = (count($row) == 1) ? current($row) : $row;
            //klucz to pierwszy element, wartość - drugi
            $kv[current($row)] = next($row);
        }
        return $kv;
    }
902326
public function setValue($key, array $value, string $table)
    {
        $this->checkTable($table);

        $this->$table->set($key, ['value' => json_encode($value)]);

        return $this;
    }
1169742
public function get($keyName, $defaultValue = null)
    {
        $this->initList();
        $keyName = strtolower($keyName);
        if (empty($this->list[$keyName])) {
            return $defaultValue;
        }
        return $this->list[$keyName];
    }
908883
public static function each($value, AbstractValidator $valueValidator, AbstractValidator $keyValidator = null)
    {
        $isValid = true;

        foreach ($value as $key => $data) {
            if ($keyValidator instanceof AbstractValidator) {
                $isValid = $isValid && $keyValidator->validate($key);
            }

            $isValid = $isValid && $valueValidator->validate($data);
        }

        return $isValid;
    }
1157508
function fromNumericResultArray($values, &$startcol) {
		foreach (static::$_columns as $column_name => &$type) {
			$this->{$column_name} = $values[$startcol++];
		}
		if (static::$_primaryKeys && !$this->hasPrimaryKeyValues()) {
			return false;
		}
		$this->castInts();
		$this->setNew(false);
		return true;
	}
841423
private function prepareSearchStatus($valueColumn, $getParamsFieldGrid, $columNamesSearchSort) {
        $valuesTranslate = explode(",", $this->translate->translate($columNamesSearchSort . '_values'));
        $valuesTranslateFlip = array_flip($valuesTranslate);
        $valuesIni = explode(",", $getParamsFieldGrid[$columNamesSearchSort]['values']);
        return (isset($valuesIni[$valuesTranslateFlip[$valueColumn]]) and ! empty($valuesIni[$valuesTranslateFlip[$valueColumn]])) ? $valuesIni[$valuesTranslateFlip[$valueColumn]] : null;
    }
887310
public static function convertIntToArray($val, array $valueSet)
    {
        if ($val === null) {
            
            return [];
        }
        $bitValueArr = array_reverse(str_split(base_convert($val, 10, 2)));
        $valueArr = [];
        foreach ($bitValueArr as $bit => $bitValue) {
            if (!isset($valueSet[$bit])) {
                throw new SetColumnConverterException(sprintf('Unknown value key: "%s"', $bit), $bit);
            }
            if ($bitValue === '1') {
                $valueArr[] = $valueSet[$bit];
            }
        }
        return $valueArr;
    }
756647
public function addResultColumn(ResultColumn $resultColumn): self
    {
        // prevent columns with the same machine_name or human_readable_name to be added
        foreach ($this->resultColumns as $column) {
            /** @var ResultColumn $column */
            if (
                $column->getHumanReadableName() === $resultColumn->getHumanReadableName() ||
                $column->getMachineName() === $resultColumn->getMachineName()
            ) {
                return $this;
            }
        }
        $this->resultColumns->attach($resultColumn);

        return $this;
    }
1238239
public function pluck($visibleColumn, $key)
    {
        if (!empty($visibleColumn) && !empty($key)) {
            $this->keyAsValue = true;
        }

        $this->visibleColumn = $visibleColumn;
        $this->key = $key;

        return $this;
    }
893136
public function findSoft($column, $value)
    {
        return $this->getFirstSoft((is_null($column) ? $this->key : $column) . ' = ?', [$value]);
    }
1194641
public function setValueArrayInt(array &$valueArray, $key, $value)
    {
        Validate::isString($key, 'key');

        if (!empty($value)) {
            Validate::isInteger($value, 'value');
            $valueArray[$key] = $value;
        }
    }