public function getRelationship($model, $name) { $method = $this->getRelationshipMethodName($name); if (method_exists($this, $method)) { $relationship = $this->{$method}($model); if ($relationship !== null && !$relationship instanceof Relationship) { throw new LogicException('Relationship method must return null or an instance of Tobscure\\JsonApi\\Relationship'); } return $relationship; } }
/** * {@inheritdoc} */ public function getRelationship($model, $name) { if ($relationship = $this->getCustomRelationship($model, $name)) { return $relationship; } return parent::getRelationship($model, $name); }