public function __construct($propertyName, Entity\Reflection $sourceReflection, Entity\Reflection $targetReflection, array $mapBy) { parent::__construct($propertyName, $sourceReflection, $targetReflection, $mapBy); if (!isset($mapBy[0])) { throw new Exception\AssociationException("You must define referenced key!"); } }
public function __construct($propertyName, Entity\Reflection $sourceReflection, Entity\Reflection $targetReflection, array $mapBy, $dominant = true) { parent::__construct($propertyName, $sourceReflection, $targetReflection, $mapBy, $dominant); if (!$targetReflection->hasPrimary()) { throw new Exception\AssociationException("Target entity must have defined primary when M:N relation used!"); } if (!isset($mapBy[0])) { throw new Exception\AssociationException("You must define join key!"); } if (!isset($mapBy[1])) { throw new Exception\AssociationException("You must define join resource!"); } if (!isset($mapBy[2])) { throw new Exception\AssociationException("You must define referencing key!!"); } }