protected function getPrimaryValue() { if (!$this->primaryValue && $this->value && $this->value->isPersisted()) { $this->primaryValue = $this->value->getValue('id'); } return $this->primaryValue; }