Adds any new automatically updated fields, so they cannot be updated by the controller

@param array $automaticallyUpdatedFields

@return void
345667
public function addAutomaticallyUpdatedFields(array $automaticallyUpdatedFields) {
        $fields = $this->getAutomaticallyUpdatedFields();
        foreach($automaticallyUpdatedFields as $field) {
            if(!in_array($field, $fields)) {
                $fields[] = $field;
            }
        }
        $this->setAutomaticallyUpdatedFields($fields);
    }
769238
private function syncUpdated(array $updated)
    {
        foreach ($updated as $key => $value) {
            $this->newQuery()
                 ->where($this->keyColumn, '=', $key)
                 ->update([$this->valueColumn => $value]);
        }
    }
816316
protected function submitAddField()
    {
        $this->setSubmitted(null, $this->getParam());
        $this->validateComponent('field');
        $this->addField();
    }
609757
public function updateCMSFields(FieldList $fields)
    {
        // Update Field Objects (from parent):
        
        parent::updateCMSFields($fields);
        
        // Create Services Tab Set:
        
        if (!$fields->fieldByName('Root.SilverWare.Services')) {
            
            $fields->addFieldToTab(
                'Root.SilverWare',
                TabSet::create(
                    'Services',
                    $this->owner->fieldLabel('Services')
                )
            );
            
        }
    }
1324618
protected function updateInternal(array $fields = [])
    {
        $values = $this->getChangedAttributes($fields);
        if (empty($values)) {
            return true;
        }

        $rows = $this->objects()
            ->filter($this->getPrimaryKeyValues())
            ->update($values);

        foreach ($values as $name => $value) {
            $this->setAttribute($name, $value);
        }
        $this->updateRelated();

        return $rows >= 0;
    }
1034793
public function updateSettingsFields(FieldList $fields)
    {
        $helpText = _t(
            __CLASS__ . '.SHOW_PAGE_UTILITIES_HELP',
            'You can disable page utilities (print, share, etc) for this page'
        );

        $fields->addFieldsToTab(
            'Root.Settings',
            array(
                LiteralField::create('PageUtilitiesHelp', $helpText),
                CheckboxField::create('ShowPageUtilities', $this->owner->fieldLabel('ShowPageUtilities'))
            )
        );
    }
525960
public function addFields($fields)
    {
        foreach ($fields as $field) {
            if (is_array($field)) {
                $this->addField(...$field);
            } else {
                $this->addField($field);
            }
        }

        return $this;
    }
276956
public function updateCMSFields(FieldList $fields)
    {
        // Update Field Objects (from parent):
        
        parent::updateCMSFields($fields);
        
        // Create Child Fields:
        
        $children = [];
        
        if (!$this->owner->config()->alignment_style_hide_text) {
            
            $children[] = ViewportsField::create(
                'TextAlignment',
                $this->owner->fieldLabel('TextAlignment'),
                $this->owner->getTextAlignmentOptions()
            );
            
        }
        
        if (!$this->owner->config()->alignment_style_hide_image) {
            
            $children[] = ViewportsField::create(
                'ImageAlignment',
                $this->owner->fieldLabel('ImageAlignment'),
                $this->owner->getImageAlignmentOptions()
            );
            
        }
        
        // Create Style Fields:
        
        if (!empty($children)) {
            
            $fields->addFieldsToTab(
                'Root.Style',
                [
                    $section = FieldSection::create(
                        'AlignmentStyle',
                        $this->owner->fieldLabel('Alignment'),
                        $children
                    )
                ]
            );
            
        }
    }
638747
public function updateCMSFields(FieldList $fields)
    {
        // Insert Meta Tab:
        
        $fields->insertAfter(
            Tab::create(
                'Meta',
                $this->owner->getMetaTabTitle()
            ),
            'Main'
        );
        
        // Iterate Meta Field Configuration:
        
        foreach ($this->owner->getMetaFieldConfig() as $name => $spec) {
            
            if ($spec) {
                
                // Initialise:
                
                $params = [];
                $before = null;
                $method = "getMeta{$name}Fields";
                
                // Determine Specification Type:
                
                if (is_array($spec)) {
                    $tab    = isset($spec['tab'])    ? $spec['tab']    : 'Root.Meta';
                    $method = isset($spec['method']) ? $spec['method'] : "getMeta{$name}Fields";
                    $before = isset($spec['before']) ? $spec['before'] : null;
                    $params = isset($spec['params']) ? $spec['params'] : [];
                } else {
                    $tab = $spec;
                }
                
                // Add Fields to Specified Tab:
                
                if ($this->owner->hasMethod($method)) {
                    $fields->addFieldsToTab($tab, $this->owner->$method($params), $before);
                }
                
            }
            
        }
        
        // Remove Meta Tab (if empty):
        
        if (!$fields->fieldByName('Root.Meta')->getChildren()->exists()) {
            $fields->removeFieldFromTab('Root', 'Meta');
        }
    }
1265847
public function updateFrontEndFields(FieldList $fields)
    {
        if (!$this->owner->ID) {
            $fields->replaceField('InheritPerms', new CheckboxField('InheritPerms', _t('Restrictable.INHERIT_PERMS', 'Inherit Permissions'), true));
        }
        
        $ownerField = $fields->fieldByName('OwnerID');
        if ($ownerField) {
            $members = singleton('DataService')->getAllMember();
            $source = array();
            if ($members) {
                $source = $members->map();
            }
            if (method_exists($ownerField, 'setSource')) {
                $ownerField->setSource($source);
            }
        }
    }
828993
public function update($fields) {
        if (is_array($fields)) {
            foreach ($fields as $key => $value) {
                if (is_string($value)) {
                    array_push($this->_updates, $key . ' = \'' . addslashes($value) . '\'');
                } else {
                    array_push($this->_updates, $key . ' = ' . $value);
                }
            }
        } else {
            return false;
        }
        
        $sql_query = 'UPDATE ' . $this->_table . 
                     ' SET ' . implode($this->_updates, ', ');
        
        // Where statements
        if (count($this->_where)) {
            $sql_query .= ' WHERE ';
            $sql_query .= implode($this->_where, ' AND ');
            
            // or statements
            if (count($this->_or)) {
                $sql_query .= ' OR ';
                $sql_query .= implode($this->_or, ' AND ');
            }
        }
        
        // Set the query
        $this->_sql_query = $sql_query;
        
        return $this;
    }
337923
public function beforeUpdate(array &$args) {
        $data = &$args[1];
        foreach ($this->_fields as $field) {
            if (!empty($data[$field])) {
                $data[$field] = $this->filter($data[$field], $this->getConfig());
            }
        }
    }
737508
protected function AddUpdateFields(&$Fields) {
      $this->DefineSchema();
      if ($this->Schema->FieldExists($this->Name, $this->DateUpdated)) {
         if (!isset($Fields[$this->DateUpdated]))
            $Fields[$this->DateUpdated] = Gdn_Format::ToDateTime();
      }

      $Session = Gdn::Session();
      if ($Session->UserID > 0 && $this->Schema->FieldExists($this->Name, $this->UpdateUserID))
         if (!isset($Fields[$this->UpdateUserID]))
            $Fields[$this->UpdateUserID] = $Session->UserID;

      if ($this->Schema->FieldExists($this->Name, 'UpdateIPAddress') && !isset($Fields['UpdateIPAddress'])) {
         $Fields['UpdateIPAddress'] = Gdn::Request()->IpAddress();
      }
   }
970549
public function updateCMSFields(FieldList $fields)
    {
        // Update Field Objects:
        
        $fields->fieldByName('Root.Main')->setTitle(_t(__CLASS__ . '.TABMAIN', 'Main'));
        
        // Remove Field Objects:
        
        if ($this->owner->config()->disable_metadata_toggle) {
            $fields->removeFieldFromTab('Root', 'Metadata');
        }
        
        // Add Tab Number Badges:
        
        if ($badges = $this->owner->getNumberBadgeData()) {
            $fields->fieldByName('Root')->setAttribute('data-number-badges', json_encode($badges));
        }
    }
395903
public function updateCMSFields(FieldList $fields)
    {
        $fieldEditor = $this->getFieldEditorGrid();

        $fields->insertAfter(new Tab('FormFields', _t(__CLASS__.'.FORMFIELDS', 'Form Fields')), 'Main');
        $fields->addFieldToTab('Root.FormFields', $fieldEditor);

        return $fields;
    }
1021837
public function updateCMSFields(FieldList $fields)
    {
        // Update Field Objects:
        
        $fields->addFieldToTab(
            'Root.FormOptions',
            CheckboxField::create(
                'EnableSpamGuard',
                $this->owner->fieldLabel('EnableSpamGuard')
            )
        );
    }
408719
public function updateCMSFields(FieldList $fields)
    {
        // Update Field Objects (from parent):
        
        parent::updateCMSFields($fields);
        
        // Create Style Fields:
        
        $fields->addFieldsToTab(
            'Root.Style',
            [
                FieldSection::create(
                    'LinkColorStyle',
                    $this->owner->fieldLabel('LinkColorStyle'),
                    [
                        FieldGroup::create(
                            $this->owner->fieldLabel('Background'),
                            [
                                ColorField::create(
                                    'ColorBackgroundLink',
                                    $this->owner->fieldLabel('Link')
                                ),
                                ColorField::create(
                                    'ColorBackgroundHover',
                                    $this->owner->fieldLabel('Hover')
                                ),
                                ColorField::create(
                                    'ColorBackgroundActive',
                                    $this->owner->fieldLabel('Active')
                                )
                            ]
                        ),
                        FieldGroup::create(
                            $this->owner->fieldLabel('Foreground'),
                            [
                                ColorField::create(
                                    'ColorForegroundLink',
                                    $this->owner->fieldLabel('Link')
                                ),
                                ColorField::create(
                                    'ColorForegroundHover',
                                    $this->owner->fieldLabel('Hover')
                                ),
                                ColorField::create(
                                    'ColorForegroundActive',
                                    $this->owner->fieldLabel('Active')
                                )
                            ]
                        )
                    ]
                )
            ]
        );
    }