Beispiel #1
0
 public function fill($related, $_skip_inverse = FALSE)
 {
     if ($related instanceof Collection) {
         $related = $related->first();
     }
     if (is_array($related)) {
         $related = array_shift($related);
     }
     return parent::fill($related, $_skip_inverse);
 }
Beispiel #2
0
 public function fill($related, $_skip_inverse = FALSE)
 {
     if (is_array($related)) {
         $related = new Collection($related);
     }
     if ($related instanceof Model) {
         $related = new Collection(array($related));
     }
     if ($related instanceof Collection) {
         $this->ensureAssociation($related);
     }
     return parent::fill($related, $_skip_inverse);
 }