Ejemplo n.º 1
0
 /**
  * @param RelationshipDefinition $relationship
  * @param null|int               $seed
  */
 public function processRelationshipDefinition(RelationshipDefinition $relationship, $seed)
 {
     switch ($relationship->getCardinality()) {
         case 'n..1':
             $this->processNTo1Relationship($relationship, $seed);
             break;
         case '1..1':
             $this->process1To1Relationship($relationship, $seed);
             break;
         case 'n..n':
             $this->processNToNRelationship($relationship, $seed);
             break;
         case '1..n':
             $this->process1ToNRelationship($relationship, $seed);
             break;
         default:
             throw new \RuntimeException(sprintf('Unable to process relationship with "%s" cardinality', $relationship->getCardinality()));
     }
 }