protected function ensureDoesNotExist($model) { if ($this->has($model)) { $this->related->remove($model); parent::ensureDoesNotExist($model); } }
protected function ensureDoesNotExist($model) { if ($this->related === $model) { $this->related = NULL; parent::ensureDoesNotExist($model); } }
/** * Set a given association * * @param String $name Name of the association * @param Association $association Association to set * @return $this */ public function setAssociation($name, Association $association) { $association->setFacade($this->getModelFacade()); $this->_associations[$name] = $association; return $this; }