예제 #1
0
파일: ToOne.php 프로젝트: vigm/advancedMD
 protected function ensureExists($model)
 {
     if ($this->related !== $model) {
         $this->related = $model;
         parent::ensureExists($model);
     }
 }
예제 #2
0
파일: ToMany.php 프로젝트: vigm/advancedMD
 protected function ensureExists($model)
 {
     $this->ensureCollection();
     if (!$this->has($model)) {
         $this->related->add($model);
         parent::ensureExists($model);
     }
 }