class TamperableComplexDataAdapter in Tamper 8
Provides an adapter to use complex typed data as a tamperable item.
Hierarchy
- class \Drupal\tamper\Adapter\TamperableComplexDataAdapter implements TamperableItemInterface
Expanded class hierarchy of TamperableComplexDataAdapter
1 file declares its use of TamperableComplexDataAdapter
- TamperableComplexDataAdapterTest.php in tests/
src/ Unit/ Adapter/ TamperableComplexDataAdapterTest.php
File
- src/
Adapter/ TamperableComplexDataAdapter.php, line 11
Namespace
Drupal\tamper\AdapterView source
class TamperableComplexDataAdapter implements TamperableItemInterface {
/**
* Typed complex data object.
*
* @var \Drupal\Core\TypedData\ComplexDataInterface
*/
protected $complexData;
/**
* Create a new instance of the adapter.
*
* @param \Drupal\Core\TypedData\ComplexDataInterface $complexData
* Typed complex data object.
*/
public function __construct(ComplexDataInterface $complexData) {
$this->complexData = $complexData;
}
/**
* {@inheritdoc}
*/
public function getSource($include_computed = FALSE) {
return $this->complexData
->toArray();
}
/**
* {@inheritdoc}
*/
public function setSourceProperty($property, $data) {
$this->complexData
->set($property, $data);
}
/**
* {@inheritdoc}
*/
public function getSourceProperty($property) {
return $this->complexData
->get($property);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TamperableComplexDataAdapter:: |
protected | property | Typed complex data object. | |
TamperableComplexDataAdapter:: |
public | function |
Returns the whole item as an array. Overrides TamperableItemInterface:: |
|
TamperableComplexDataAdapter:: |
public | function |
Retrieves a source property. Overrides TamperableItemInterface:: |
|
TamperableComplexDataAdapter:: |
public | function |
Sets a source property. Overrides TamperableItemInterface:: |
|
TamperableComplexDataAdapter:: |
public | function | Create a new instance of the adapter. |