1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 21:34:04 +00:00

HasArrayAccess trait

This commit is contained in:
Samuel Štancl 2019-09-05 19:26:19 +02:00
parent f471a1a7e4
commit 798df54d76

View file

@ -0,0 +1,26 @@
<?php
namespace Stancl\Tenancy\Traits;
trait HasArrayAccess
{
public function offsetExists($offset): bool
{
return property_exists($this, $offset);
}
public function offsetGet($offset)
{
return $this->$offset;
}
public function offsetSet($offset, $value): void
{
$this->$offset = $value;
}
public function offsetUnset($offset): void
{
unset($this->$offset);
}
}