Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Return all the keys or a subset of the keys of an array
<?php array_keys(array $array): array
<?php public static function getAvailableDrivers(): array
{
return array_keys(self::DRIVER_MAP);
}
<?php if (isset($params['driver'])) {
if (! isset(self::DRIVER_MAP[$params['driver']])) {
throw Exception::unknownDriver($params['driver'], array_keys(self::DRIVER_MAP));
}
$class = self::DRIVER_MAP[$params['driver']];
<?php private function replaceColumn($tableName, array $columns, $columnName, Column $column): array
{
$keys = array_keys($columns);
$index = array_search(strtolower($columnName), $keys, true);
if ($index === false) {
<?php public function resetQueryParts($queryPartNames = null)
{
if ($queryPartNames === null) {
$queryPartNames = array_keys($this->sqlParts);
}
foreach ($queryPartNames as $queryPartName) {
<?php {
foreach ($this->sqlParts['join'] as $fromAlias => $joins) {
if (! isset($knownAliases[$fromAlias])) {
throw QueryException::unknownAlias($fromAlias, array_keys($knownAliases));
}
}
}
<?php private function getSQLForInsert()
{
return 'INSERT INTO ' . $this->sqlParts['from']['table'] .
' (' . implode(', ', array_keys($this->sqlParts['values'])) . ')' .
' VALUES(' . implode(', ', $this->sqlParts['values']) . ')';
}
<?php if (isset($this->sqlParts['join'][$fromAlias])) {
foreach ($this->sqlParts['join'][$fromAlias] as $join) {
if (array_key_exists($join['joinAlias'], $knownAliases)) {
throw QueryException::nonUniqueAlias($join['joinAlias'], array_keys($knownAliases));
}
$sql .= ' ' . strtoupper($join['joinType'])
<?php $customOptions1 = $column1->getCustomSchemaOptions();
$customOptions2 = $column2->getCustomSchemaOptions();
foreach (array_merge(array_keys($customOptions1), array_keys($customOptions2)) as $key) {
if (! array_key_exists($key, $properties1) || ! array_key_exists($key, $properties2)) {
$changedProperties[] = $key;
} elseif ($properties1[$key] !== $properties2[$key]) {
<?php $platformOptions1 = $column1->getPlatformOptions();
$platformOptions2 = $column2->getPlatformOptions();
foreach (array_keys(array_intersect_key($platformOptions1, $platformOptions2)) as $key) {
if ($properties1[$key] === $properties2[$key]) {
continue;
}
<?php public function getLocalColumns()
{
return array_keys($this->_localColumnNames);
}
<?php public function getForeignColumns()
{
return array_keys($this->_foreignColumnNames);
}
<?php public function getColumns()
{
return array_keys($this->_columns);
}
<?php public function getFlags()
{
return array_keys($this->_flags);
}
<?php $list = [];
foreach ($this->filterAssetNames(array_keys($sequenceDefinitions)) as $sequenceName) {
$list[] = $this->_getPortableSequenceDefinition($sequenceDefinitions[$sequenceName]);
}
<?php public function getTableNames()
{
return array_keys($this->_tables);
}