Esempio n. 1
0
 public function offsetSet($offset, $value)
 {
     if (!$value instanceof ScheduleWizardDate) {
         throw new \Bixev\InterventionSdk\Exception('trying to set non valid element');
     }
     parent::offsetSet($offset, $value);
 }
Esempio n. 2
0
 /**
  * @param mixed $offset
  * @param Route $value
  */
 public function offsetSet($offset, $value)
 {
     if (!$value instanceof Route || !$value->isValid()) {
         throw new \Bixev\InterventionSdk\Exception('trying to set non valid route');
     }
     if ($this->findByIdentifier($value->identifier) !== null) {
         foreach ($this as $k => $route) {
             if ($route->identifier == $value->identifier) {
                 $this[$k] = $value;
             }
         }
     } else {
         parent::offsetSet($offset, $value);
     }
 }