public function hasAssociation($fieldName) { foreach ($this->relationships as $relationship) { if ($relationship->getPropertyName() === $fieldName) { return true; } } return false; }