public function DefaultTableMapping::setFieldNames

public DefaultTableMapping::setFieldNames($table_name, array $field_names)

Adds field columns for a table to the table mapping.

Parameters

string $table_name: The name of the table to add the field column for.

string[] $field_names: A list of field names to add the columns for.

Return value

$this

File

core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php, line 231

Class

DefaultTableMapping
Defines a default table mapping class.

Namespace

Drupal\Core\Entity\Sql

Code

public function setFieldNames($table_name, array $field_names) {
  $this->fieldNames[$table_name] = $field_names;
  // Force the re-computation of the column list.
  unset($this->allColumns[$table_name]);
  return $this;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!Sql!DefaultTableMapping.php/function/DefaultTableMapping::setFieldNames/8.1.x