mirror of
https://github.com/processwire/processwire.git
synced 2025-08-13 02:04:35 +02:00
Minor optimization for Page::isLoaded($fieldName) method
This commit is contained in:
@@ -3819,7 +3819,10 @@ class Page extends WireData implements \Countable, WireMatchable {
|
||||
*
|
||||
*/
|
||||
public function isLoaded($fieldName = null) {
|
||||
if($fieldName) return parent::get($fieldName) !== null;
|
||||
if($fieldName) {
|
||||
if($this->hasField($fieldName)) return isset($this->data[$fieldName]);
|
||||
return parent::get($fieldName) !== null;
|
||||
}
|
||||
return $this->isLoaded;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user