예제 #1
0
 /**
  * Sets an index in the PageArray.
  *
  * @param int $key Key of item to set.
  * @param Page $value Value of item. 
  * @return $this
  * 
  */
 public function set($key, $value)
 {
     $has = $this->has($key);
     parent::set($key, $value);
     if (!$has) {
         $this->numTotal++;
     }
     return $this;
 }
 public function set($key, $value)
 {
     if (SelectableOption::isProperty($key)) {
         return $this->setProperty($key, $value);
     }
     return parent::set($key, $value);
 }
예제 #3
0
 /**
  * Set a setting or custom property for this Role
  *
  * @param string $key
  * @param mixed $value
  * @return this
  *
  */
 public function set($key, $value)
 {
     if ($key === 'id') {
         $this->settings['id'] = (int) $value;
     } else {
         if ($key === 'name') {
             $this->settings['name'] = $this->fuel('sanitizer')->name($value);
         } else {
             return parent::set($key, $value);
         }
     }
     return $this;
 }
예제 #4
0
 /**
  * Overridden ProcessArray set
  *
  * @param string $key
  * @param string|int|object $value
  * @return Fieldgroup $this
  *
  */
 public function set($key, $value)
 {
     if ($key == 'id') {
         $value = (int) $value;
     } else {
         if ($key == 'name') {
             $value = $this->fuel('sanitizer')->name($value);
         }
     }
     if (isset($this->settings[$key])) {
         if ($this->settings[$key] !== $value) {
             $this->trackChange($key);
         }
         $this->settings[$key] = $value;
     } else {
         return parent::set($key, $value);
     }
     return $this;
 }
예제 #5
0
 /**
  * Overridden ProcessArray set
  *
  * @param string $key
  * @param string|int|object $value
  * @return Fieldgroup $this
  * @throws WireException if passed invalid data
  *
  */
 public function set($key, $value)
 {
     if ($key == 'data') {
         return $this;
     }
     // we don't have a data field here
     if ($key == 'id') {
         $value = (int) $value;
     } else {
         if ($key == 'name') {
             $value = $this->wire('sanitizer')->name($value);
         }
     }
     if (isset($this->settings[$key])) {
         if ($this->settings[$key] !== $value) {
             $this->trackChange($key, $this->settings[$key], $value);
         }
         $this->settings[$key] = $value;
     } else {
         return parent::set($key, $value);
     }
     return $this;
 }