/** * 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); }
/** * 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; }
/** * 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; }
/** * 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; }