/** * 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; }
/** * @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; }