コード例 #1
0
ファイル: OneToOne.php プロジェクト: bauer01/unimapper
 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 referencing key!");
     }
     if (!$targetReflection->hasPrimary()) {
         throw new Exception\AssociationException("Target entity must have defined primary when 1:1 relation used!");
     }
 }