/**
  * {@inheritdoc}
  */
 public function __construct($manager, $metadata, $mapping)
 {
     parent::__construct($manager, $metadata, $mapping);
     $this->keyFrom = $mapping['keyFrom'] ? $mapping['keyFrom'] : $this->targetMetadata->getIdentifier();
     $this->keyTo = $mapping['keyTo'] ? $mapping['keyTo'] : $metadata->getIdentifier();
     $this->tableThrough = $mapping['tableThrough'];
     $this->keyThroughFrom = $mapping['keyThroughFrom'];
     $this->keyThroughTo = $mapping['keyThroughTo'];
     $this->orderBy = $mapping['orderBy'];
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function __construct($manager, $metadata, $mapping)
 {
     parent::__construct($manager, $metadata, $mapping);
     $this->keyFrom = $mapping['keyFrom'] ? $mapping['keyFrom'] : $metadata->getIdentifier();
     $this->keyTo = $mapping['keyTo'];
     foreach ($this->targetMetadata->getRelationMappings() as $mapping) {
         if ($mapping['type'] == 'BelongsTo' && $mapping['targetEntity'] == $this->metadata->getClass()) {
             $this->belongsTo = $mapping['name'];
             break;
         }
     }
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function __construct($manager, $metadata, $mapping)
 {
     parent::__construct($manager, $metadata, $mapping);
     $this->keyFrom = $mapping['keyFrom'];
     $this->keyTo = $mapping['keyTo'] ? $mapping['keyTo'] : $this->targetMetadata->getIdentifier();
 }