You are here

class ArrayWrapper in RESTful 7.2

Hierarchy

Expanded class hierarchy of ArrayWrapper

2 files declare their use of ArrayWrapper
DataProviderDbQuery.php in src/Plugin/resource/DataProvider/DataProviderDbQuery.php
Contains \Drupal\restful\Plugin\resource\DataProvider\DataProviderDbQuery.
DataProviderVariable.php in modules/restful_example/src/Plugin/resource/variables/DataProviderVariable.php
Contains \Drupal\restful_example\Plugin\resource\variables\DataProviderVariable.

File

src/Plugin/resource/DataInterpreter/ArrayWrapper.php, line 10
Contains \Drupal\restful\Plugin\resource\DataInterpreter\ArrayWrapper.

Namespace

Drupal\restful\Plugin\resource\DataInterpreter
View source
class ArrayWrapper implements ArrayWrapperInterface {

  /**
   * Plugin configuration.
   *
   * @var array
   */
  protected $data = array();

  /**
   * Constructs a PluginWrapper object.
   *
   * @param array $data
   *   The array to wrap
   */
  public function __construct(array $data) {
    $this->data = $data;
  }

  /**
   * {@inheritdoc}
   */
  public function get($key) {
    return isset($this->data[$key]) ? $this->data[$key] : NULL;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ArrayWrapper::$data protected property Plugin configuration.
ArrayWrapper::get public function Gets a field from the data array. Overrides ArrayWrapperInterface::get
ArrayWrapper::__construct public function Constructs a PluginWrapper object.