/**
  * Load all the Fieldgroups from the database
  *
  * The loading is delegated to WireSaveableItems.
  * After loaded, we check for any 'global' fields and add them to the Fieldgrou, if not already there.
  *
  * @param Selectors|string|null $selectors Selectors or a selector string to find, or NULL to load all. 
  * @return WireArray Returns the same type as specified in the getAll() method.
  *
  */
 protected function ___load(WireArray $items, $selectors = null)
 {
     $items = parent::___load($items, $selectors);
     foreach ($this->fuel('fields') as $field) {
         if ($field->flags & Field::flagGlobal) {
             foreach ($items as $item) {
                 if (!$item->has($field)) {
                     $item->add($field);
                 }
             }
         }
     }
     return $items;
 }
Example #2
0
 /**
  * Load all the Fieldgroups from the database
  *
  * The loading is delegated to WireSaveableItems.
  * After loaded, we check for any 'global' fields and add them to the Fieldgroup, if not already there.
  *
  * @param Selectors|string|null $selectors Selectors or a selector string to find, or NULL to load all. 
  * @return WireArray Returns the same type as specified in the getAll() method.
  *
  */
 protected function ___load(WireArray $items, $selectors = null)
 {
     $items = parent::___load($items, $selectors);
     return $items;
 }