You are here

protected function DataProviderEntity::getColumnFromProperty in RESTful 7.2

Get the DB column name from a property.

The "property" defined in the public field is actually the property of the entity metadata wrapper. Sometimes that property can be a different name than the column in the DB. For example, for nodes the "uid" property is mapped in entity metadata wrapper as "author", so we make sure to get the real column name.

Parameters

string $property_name: The property name.

Return value

string The column name.

2 calls to DataProviderEntity::getColumnFromProperty()
DataProviderEntity::queryForListFilter in src/Plugin/resource/DataProvider/DataProviderEntity.php
Filter the query for list.
DataProviderEntity::queryForListSort in src/Plugin/resource/DataProvider/DataProviderEntity.php
Sort the query for list.

File

src/Plugin/resource/DataProvider/DataProviderEntity.php, line 883
Contains \Drupal\restful\Plugin\resource\DataProvider\DataProviderEntity.

Class

DataProviderEntity
Class DataProviderEntity.

Namespace

Drupal\restful\Plugin\resource\DataProvider

Code

protected function getColumnFromProperty($property_name) {
  $property_info = entity_get_property_info($this->entityType);
  return $property_info['properties'][$property_name]['schema field'];
}