public function display($name)
{
if ($c = $this->getSchema()->getColumn($name)) {
// get raw value
if ($c->virtual) {
return $this->get($name);
}
return $c->display($this->getValue($name));
} elseif (isset($this->_data[$name])) {
return $this->_data[$name];
}
// for relationship record
$val = $this->__get($name);
if ($val && $val instanceof \LazyRecord\BaseModel) {
return $val->dataLabel();
}
}