mirror of
https://github.com/processwire/processwire.git
synced 2025-08-14 18:55:56 +02:00
Optimization to Page::setQuietly() method to support more direct setting of integer base properties in Page::$settings
This commit is contained in:
@@ -967,7 +967,12 @@ class Page extends WireData implements \Countable, WireMatchable {
|
|||||||
*/
|
*/
|
||||||
public function setQuietly($key, $value) {
|
public function setQuietly($key, $value) {
|
||||||
$this->quietMode = true;
|
$this->quietMode = true;
|
||||||
|
if(isset($this->settings[$key]) && is_int($value)) {
|
||||||
|
// allow integer-only values in $this->settings to be set directly in quiet mode
|
||||||
|
$this->settings[$key] = $value;
|
||||||
|
} else {
|
||||||
parent::setQuietly($key, $value);
|
parent::setQuietly($key, $value);
|
||||||
|
}
|
||||||
$this->quietMode = false;
|
$this->quietMode = false;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user