Exemplo n.º 1
0
 public function __construct($propertyName, Entity\Reflection $sourceReflection, Entity\Reflection $targetReflection, array $mapBy, $dominant = true)
 {
     $this->propertyName = $propertyName;
     $this->sourceReflection = $sourceReflection;
     $this->targetReflection = $targetReflection;
     $this->dominant = (bool) $dominant;
     $this->mapBy = $mapBy;
     if (!$this->sourceReflection->hasAdapter()) {
         throw new Exception\AssociationException("Can not use associations while source entity " . $sourceReflection->getName() . " has no adapter defined!");
     }
     if (!$this->targetReflection->hasAdapter()) {
         throw new Exception\AssociationException("Can not use associations while target entity " . $targetReflection->getName() . " has no adapter defined!");
     }
 }