public function getRelativeName() { if ($this->relative) { if ($this->relative->is_other) { return $this->other_relative; } else { return $this->relative->name; } } else { return 'N/A'; } }