Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function extract($model)
 {
     // Strange, but relations are still resolved even when model doesn't
     // really exists, so wee need to handle this case.
     if (!$model->exists) {
         return $this->isMultiple() ? [] : null;
     }
     $data = parent::extract($model);
     return $data ? $this->reference->simplify($data) : null;
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function extractForColumn($model)
 {
     return $this->reference->simplify(parent::extract($model));
 }