/** * {@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; }
/** * {@inheritdoc} */ public function extractForColumn($model) { return $this->reference->simplify(parent::extract($model)); }