1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-13 18:24:57 +02:00

Optimization to Page::setQuietly() method to support more direct setting of integer base properties in Page::$settings

This commit is contained in:
Ryan Cramer
2019-09-24 11:43:23 -04:00
parent aae7302283
commit 6c755a8a9c

View File

@@ -967,7 +967,12 @@ class Page extends WireData implements \Countable, WireMatchable {
*/
public function setQuietly($key, $value) {
$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);
}
$this->quietMode = false;
return $this;
}