lithium\data\Collection::offsetGet PHP Method

offsetGet() public method

Gets an Entity object using PHP's array syntax, i.e. $documents[3] or $records[5].
public offsetGet ( mixed $offset ) : mixed
$offset mixed The offset.
return mixed Returns an `Entity` object if exists otherwise returns `null`.
    public function offsetGet($offset)
    {
        while (!array_key_exists($offset, $this->_data) && $this->_populate()) {
        }
        if (array_key_exists($offset, $this->_data)) {
            return $this->_data[$offset];
        }
        return null;
    }