Exemplo n.º 1
0
 protected function ensureExists($model)
 {
     if ($this->related !== $model) {
         $this->related = $model;
         parent::ensureExists($model);
     }
 }
Exemplo n.º 2
0
 protected function ensureExists($model)
 {
     $this->ensureCollection();
     if (!$this->has($model)) {
         $this->related->add($model);
         parent::ensureExists($model);
     }
 }