class ArrayDeprecationWrapper in Entity Construction Kit (ECK) 8
Class ArrayDeprecationWrapper
@package Drupal\eck
Hierarchy
- class \Drupal\eck\ArrayDeprecationWrapper implements \Drupal\eck\ArrayAccess, RenderableInterface
Expanded class hierarchy of ArrayDeprecationWrapper
1 file declares its use of ArrayDeprecationWrapper
- eck.module in ./
eck.module - Contains hook implementations.
File
- src/
ArrayDeprecationWrapper.php, line 12
Namespace
Drupal\eckView source
class ArrayDeprecationWrapper implements \ArrayAccess, RenderableInterface {
/**
* The deprecated array.
*
* @var array
*/
private $wrappedArray;
/**
* The deprecation warning to set.
*
* @var string
*/
private $deprecationWarning;
/**
* ArrayDeprecationWrapper constructor.
*
* @param array $wrappedArray
* The array being deprecated.
* @param $deprecationWarning
* The warning that should be raised when it is accessed.
*/
public function __construct(array &$wrappedArray, $deprecationWarning) {
$this->wrappedArray = $wrappedArray;
$this->deprecationWarning = $deprecationWarning;
}
/**
* {@inheritdoc}
*/
public function offsetExists($offset) {
trigger_error($this->deprecationWarning, E_USER_DEPRECATED);
return isset($this->wrappedArray[$offset]);
}
/**
* {@inheritdoc}
*/
public function offsetGet($offset) {
trigger_error($this->deprecationWarning, E_USER_DEPRECATED);
return $this->wrappedArray[$offset];
}
/**
* {@inheritdoc}
*/
public function offsetSet($offset, $value) {
trigger_error($this->deprecationWarning, E_USER_DEPRECATED);
$this->wrappedArray[$offset] = $value;
}
/**
* {@inheritdoc}
*/
public function offsetUnset($offset) {
trigger_error($this->deprecationWarning, E_USER_DEPRECATED);
unset($this->wrappedArray[$offset]);
}
/**
* Returns a render array representation of the object.
*
* @return mixed[]
* A render array.
*/
public function toRenderable() {
trigger_error($this->deprecationWarning, E_USER_DEPRECATED);
return $this->wrappedArray;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ArrayDeprecationWrapper:: |
private | property | The deprecation warning to set. | |
ArrayDeprecationWrapper:: |
private | property | The deprecated array. | |
ArrayDeprecationWrapper:: |
public | function | ||
ArrayDeprecationWrapper:: |
public | function | ||
ArrayDeprecationWrapper:: |
public | function | ||
ArrayDeprecationWrapper:: |
public | function | ||
ArrayDeprecationWrapper:: |
public | function |
Returns a render array representation of the object. Overrides RenderableInterface:: |
|
ArrayDeprecationWrapper:: |
public | function | ArrayDeprecationWrapper constructor. |