You are here

protected function DataProviderVariable::searchPublicFieldByProperty in RESTful 7.2

Finds the public field name that has the provided property.

Parameters

string $property: The property to find.

Return value

string The name of the public name.

2 calls to DataProviderVariable::searchPublicFieldByProperty()
DataProviderVariable::create in modules/restful_example/src/Plugin/resource/variables/DataProviderVariable.php
Create operation.
DataProviderVariable::update in modules/restful_example/src/Plugin/resource/variables/DataProviderVariable.php
Update operation.

File

modules/restful_example/src/Plugin/resource/variables/DataProviderVariable.php, line 241
Contains \Drupal\restful_example\Plugin\resource\variables\DataProviderVariable.

Class

DataProviderVariable
Class DataProviderVariable.

Namespace

Drupal\restful_example\Plugin\resource\variables

Code

protected function searchPublicFieldByProperty($property) {
  foreach ($this->fieldDefinitions as $public_name => $resource_field) {
    if ($resource_field
      ->getProperty() == $property) {
      return $public_name;
    }
  }
  return NULL;
}