Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Exemple of Record::__get()

View gist:3114191
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
public function &__get($name) {
$value = parent::__get($name);
if (is_array($value) && ($model = $this->_model) && ($relname = $model::relationship($name))) {
$rel = $model::relations($relname);
$type = $rel->type();
$modelTo = $rel->to();
if ($type == 'hasOne' || $type == 'belongsTo') {
$value = $model::connection()->item($modelTo, $value, array('class' => 'entity'));
} else {
$value = $model::connection()->item($modelTo, $value, array('class' => 'set'));
}
$this->_updated[$name] = $value;
}
return $value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.