Пример #1
0
 /**
  * updates the whole setting section
  * firsts it renders the input names of the submitted form
  * into database fields
  * it also merge the current settings or update the submitted settings into
  * db .
  * it also use serialization for each fields
  *
  * @param boolean $blogApi
  */
 public static function update($blogApi = false)
 {
     /**
      * set Self::$settings with Applum::find(1)
      */
     self::setSettings();
     /**
      * renders submitted form inputs
      * which is compatible with the database structure
      *
      * IMPORTANT : I have to fine a better place for this one
      */
     DataFormatter::render($blogApi);
     /**
      * updates uploaded file info into database
      */
     AFile::updateFile();
     /**
      * for the sake of serialization there is some boundaries . we can`t
      * change new settings with the current one , we have to maintain the untouched
      * settings and update the touched ones .
      */
     self::use_submitted_info_and_leave_untouch_settings();
     self::$settings->save();
 }