public function &__get($key)
{
if ($this->accessColumn($key)) {
return $this->data[$key];
}
$referenced = $this->table->getReferencedTable($this, $key);
if ($referenced !== FALSE) {
$this->accessColumn($key, FALSE);
return $referenced;
}
$this->removeAccessColumn($key);
$hint = Nette\Utils\ObjectMixin::getSuggestion(array_keys($this->data), $key);
throw new Nette\MemberAccessException("Cannot read an undeclared column '{$key}'" . ($hint ? ", did you mean '{$hint}'?" : '.'));
}