/** * @param array $mappedClass * @param Mapping $mapping * @param string $className * * @throws MappingException */ protected static function setRelationships(array &$mappedClass, Mapping $mapping, string $className) { if (!empty($mappedClass[static::RELATIONSHIPS_KEY])) { foreach ($mappedClass[static::RELATIONSHIPS_KEY] as $propertyName => $urls) { if (false === \in_array($propertyName, static::getClassProperties($className))) { throw new MappingException(\sprintf('Could not find property %s in class %s because it does not exist.', $propertyName, $className)); } $mapping->setRelationshipUrls($propertyName, $urls); } } }