lithium\data\Collection::offsetGet()

public method

Gets an Entity object using PHP's array syntax, i.e. $documents[3] or $records[5].

Parameters

  • mixed $offset

    The offset.

Returns

mixed

Returns an Entity object if exists otherwise returns null.

Source

	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;
	}