lox/pheasant — pull request #61 by arthens (2013-05-28 10:33:11+00:00)
Title: Implement ArrayAccess in DomainObject

## What this is

This pull request adds support for the `ArrayAccess` interface in DomainObject

## Why

Some libraries (e.g. `Twig`) rely on standard interfaces/functions to check if a property exists. However, Pheasant doesn't support any (?) standard method to check the existence of null properties.

- `isset` will call `__isset`, which correctly return false when the value is `null`
- `property_exists` doesn't work with magic setters and getters
- `array_key_exists` doesn't work, because it's not an array and it's not a real property

Pheasant supports `has($name)`, but it's not a standard and libraries are unlikely to check it.

## Why ArrayAccess

Implementing ArrayAccess means that

`isset($object[$propertyName])`

will return `true` for null values, and will provide a standard way of checking if a property exists (independently of the value).