Exemple #1
0
 /**
  * Add a foreign column for the relation
  *
  * @param Column $column
  *
  * @return $this
  * @throws Exception\Manager
  */
 public function addForeignForeignColumn(Column $column)
 {
     $alias = $this->normalizeName($column->getName());
     if ($this->foreignForeignColumns->offsetExists($alias) === true) {
         throw Exception\Relation::foreignForeignColumnAlreadyExists($alias, $this->getName());
     }
     $this->foreignForeignColumns->offsetSet($alias, $column);
     return $this;
 }
Exemple #2
0
 /**
  * @param string $type See (static::TYPE_*)
  *
  * @return Relation
  * @throws Exception\Relation
  */
 public function setType($type)
 {
     if (in_array($type, $this->types) === false) {
         throw Exception\Relation::invalidType($type, $this->getName());
     }
     $this->type = $type;
     return $this;
 }