Skip to content

Instantly share code, notes, and snippets.

@simonwelsh
Created September 3, 2014 05:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonwelsh/9b1c3d6eeada0d93e755 to your computer and use it in GitHub Desktop.
Save simonwelsh/9b1c3d6eeada0d93e755 to your computer and use it in GitHub Desktop.
/**
* (non-PHPdoc)
* @see ArrayAccess::offsetGet()
*/
public function offsetGet($offset) {
$column = idx(static::$_columns,$offset);
if (!$column) return idx($this->_data,$offset);
if (!isset($this->_castedColumns[$offset])) {
$this->_data[$offset] = $column->cast($column->parseFromDatabase(
idx($this->_data,$offset)));
$this->_castedColumns[$offset] = true;
}
return $this->_data[$offset];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment