Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  *
  * Record will skip filtration for nullable fields.
  */
 public function getField($name, $default = null, $filter = true)
 {
     if (!array_key_exists($name, $this->fields)) {
         throw new RecordException("Undefined field '{$name}' in '" . static::class . "'.");
     }
     $value = $this->fields[$name];
     if ($value === null && in_array($name, $this->ormSchema[ORM::M_NULLABLE])) {
         if (!isset($this->ormSchema[ORM::M_MUTATORS]['accessor'][$name])) {
             //We can skip setters for null values, but not accessors
             return $value;
         }
     }
     return parent::getField($name, $default, $filter);
 }