Get key list (index, unique). Ex. index => true OR index => 'somename'
@param  string $columnName Column name (underscore field name)
@param  bool | string $keyValue
@return array
325913
protected function getKeyList($columnName, $keyValue, array $keyList)
    {
        if ($keyValue === true) {
            $tableIndexName = SchemaUtils::generateIndexName($columnName);
            $keyList[$tableIndexName] = array($columnName);
        } else if (is_string($keyValue)) {
            $tableIndexName = SchemaUtils::generateIndexName($keyValue);
            $keyList[$tableIndexName][] = $columnName;
        }

        return $keyList;
    }
1102410
private function getField($columnName) {
        foreach($this->getFields() as $field) {
            if($field->getName() == $columnName) {
                return $field;
            }
        }
        echo 'Could Not Find Field '.$this->getTableName().'.'.$columnName."\n";
        return false;
    }
23532
public function getValue($item, $columnName)
    {
        if (is_array($item)) {
            if (isset($item[$columnName])) {
                return $item[$columnName];
            } else {
                return '';
            }
        }

        $accessor = PropertyAccess::createPropertyAccessor();

        if ($accessor->isReadable($item, $columnName)) {
            $result = $accessor->getValue($item, $columnName);
        } else {
            return sprintf('undefined function [get/is/has]%s()', $columnName);
        }

        return $result;
    }
966434
final public function fetchOneColumn($column, $key, $value)
    {
        $this->validateShortcutData();

        return $this->db->select($column)
                        ->from(static::getTableName())
                        ->whereEquals($key, $value)
                        ->query($column);
    }
872427
public function getIndexes($columnName = null) {
        if (!$this->indexes) {
            $this->indexes = array();
        }
        return ($columnName) ? $this->indexes[$columnName] : $this->indexes;
    }
484564
protected function getValueForColumns($object, array $columns)
    {
        $value = $object;

        foreach ($columns as $eachKeyColumn) {
            $keyGetterMethod = 'get' . $eachKeyColumn;
            $value = $value->$keyGetterMethod();
        }

        return $value;
    }
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;
    }
614074
public function getPrimaryKey()
    {
        $pk = array();
        foreach ($this->columnList as $col) {
            if ($col->isPrimaryKey()) {
                $pk[] = $col;
            }
        }

        return $pk;
    }
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;
    }
916098
final private function getSqlKeyValues() {
		
		// force to array
		$propertyNames = (array)$this->keyProperties;

		// list to return
		$values = array();

		foreach ($propertyNames as $name) {
			$values[] = $this->{$name};
		}

		return $values;

	}
175718
private List<Column> filterKeyColumn(CqlRow row) {
    if ( suppressKeyInColumns && row.isSetColumns() && row.columns.size() > 0) {
      Iterator<Column> columnsIterator = row.getColumnsIterator();
      Column column = columnsIterator.next();
      if ( column.name.duplicate().equals(KEY_BB) ) {
        columnsIterator.remove();  
      }      
    }
    return row.getColumns();
  }
118757
public static function column(Array $input, $columnKey, $indexKey = null)
	{
		$result = array();
		if (null === $indexKey) {
			if (null === $columnKey) {
				$result = array_values($input);
			} else {
				foreach ($input as $row) {
					switch (gettype($row)) {
						case "array":
							$result[] = $row[$columnKey];
							break;
						case "object":
							$result[] = $row->$columnKey;
							break;
					}
				}
			}
		} else {
			if (null === $columnKey) {
				foreach ($input as $row) {
					$result[$row[$indexKey]] = $row;
				}
			} else {
				foreach ($input as $row) {
					$result[$row[$indexKey]] = $row[$columnKey];
				}
			}
		}

		return $result;
	}
1353348
protected function getIndexes($tableName)
    {
        $indexes = [];
        $rows = $this->fetchAll(sprintf('SHOW INDEXES FROM %s', $this->quoteTableName($tableName)));
        foreach ($rows as $row) {
            if (!isset($indexes[$row['Key_name']])) {
                $indexes[$row['Key_name']] = ['columns' => []];
            }
            $indexes[$row['Key_name']]['columns'][] = strtolower($row['Column_name']);
        }

        return $indexes;
    }
634794
public function getColumn($columnKey)
    {
        $columns = $this->searchable();

        if (array_key_exists($columnKey, $columns)) {
            return $columns[$columnKey];
        }

        foreach ($columns as $column) {
            if ($column === $columnKey || ends_with($column, ".{$columnKey}")) {
                return $column;
            }
        }
    }
1022178
public function getPropertiesRequiredFor(string $columnName) : array
    {
        $propertyNames = [];

        foreach ($this->propertyComponentIdMap as $propertyName => $componentId) {
            if ($this->getColumnNameFromComponentId($componentId) === $columnName) {
                $propertyNames[$propertyName] = $propertyName;
            }
        }

        return $propertyNames;
    }
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;
    }
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);
        });
    }