function ForeignKey::toArray
Overrides KeyBase::toArray
File
-
core/
lib/ Drupal/ Core/ Database/ SchemaDefinition/ ForeignKey.php, line 65
Class
- ForeignKey
- Describes a database foreign key.
Namespace
Drupal\Core\Database\SchemaDefinitionCode
public function toArray() : array {
$match = [];
for ($i = 0; $i < count($this->columns); $i++) {
$localColumnName = $this->columns[$i]->name;
$foreignColumnName = $this->foreignColumns[$i]->name;
$match[$localColumnName] = $foreignColumnName;
}
return [
'table' => $this->foreignTable,
'columns' => $match,
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.