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