mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2025-01-15 08:11:14 +01:00
70 lines
1.3 KiB
PHP
70 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Xentral\Components\I18n\Dataaccess;
|
|
|
|
/**
|
|
* Provides array access functions to the data provider.
|
|
*
|
|
* @see \ArrayAccess
|
|
* @see DataProvider
|
|
* @see DataProviderInterface
|
|
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
|
*/
|
|
trait ArrayAccessTrait
|
|
{
|
|
/**
|
|
* Whether an offset exists.
|
|
*
|
|
* @param string $offset
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function offsetExists($offset): bool
|
|
{
|
|
return array_key_exists($offset, $this->DataProvider_DATA);
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* Offset to retrieve.
|
|
*
|
|
* @param string $offset
|
|
*
|
|
* @return array
|
|
*/
|
|
public function offsetGet($offset): array
|
|
{
|
|
return $this->DataProvider_DATA[$offset];
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* Assign a value to the specified offset.
|
|
* No function since data set is read only.
|
|
*
|
|
* @param string $offset
|
|
* @param array $value
|
|
*/
|
|
public function offsetSet($offset, $value)
|
|
{
|
|
// $this->DataProvider_DATA[$offset]=$value;
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* Unset an offset.
|
|
* No function since data set is read only.
|
|
*
|
|
* @param string $offset
|
|
*/
|
|
public function offsetUnset($offset)
|
|
{
|
|
// unset($this->DataProvider_DATA[$offset]);
|
|
}
|
|
}
|