當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tool::save方法代碼示例

本文整理匯總了PHP中Tool::save方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tool::save方法的具體用法?PHP Tool::save怎麽用?PHP Tool::save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Tool的用法示例。


在下文中一共展示了Tool::save方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: save

 /**
  * Overload saving to set the created time and to create a new token
  * when the object is saved.
  */
 public function save($sample = FALSE)
 {
     if ($this->loaded === FALSE) {
         if ($sample) {
             $album->name = 'My Photo Album';
             $album->view = 'lightbox';
             $album->images = '[
       {
         "path": "images/sunflower.jpg",
         "caption": "a sunflower"
       },
       {
         "path": "images/sun.jpg",
         "caption": "a very cool looking sun"
       },
       {
         "path": "images/goose.jpg",
         "caption": "a goose"
       },
       {
         "path": "images/lens.jpg",
         "caption": "a techy camera lens"
       },
       {
         "path": "images/sand-castle.jpg",
         "caption": "a tall sand castle"
       }
     ]';
         }
     }
     return parent::save();
 }
開發者ID:plusjade,項目名稱:plusjade,代碼行數:36,代碼來源:album.php

示例2: approve

 function approve($id)
 {
     if ($_POST) {
         $rs = new Tool($id);
         $rs->from_array($_POST);
         $rs->save();
     }
 }
開發者ID:unisexx,項目名稱:imac,代碼行數:8,代碼來源:tools.php

示例3: save

 /**
  * Overload saving to set the created time and to create a new token
  * when the object is saved.
  */
 public function save($sample = FALSE)
 {
     if ($this->loaded === FALSE) {
         if ($sample) {
             $this->body = View::factory('public_text/sample')->render();
         }
     }
     return parent::save();
 }
開發者ID:plusjade,項目名稱:plusjade,代碼行數:13,代碼來源:text.php

示例4: save

 /**
  * Overload saving to set the created time and to create a new token
  * when the object is saved.
  */
 public function save($sample = FALSE)
 {
     if ($this->loaded === FALSE) {
         if ($sample) {
             $this->body = 'yahboi';
         }
     }
     return parent::save();
 }
開發者ID:plusjade,項目名稱:plusjade,代碼行數:13,代碼來源:format.php

示例5: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Tool();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Tool'])) {
         $model->attributes = $_POST['Tool'];
         if ($model->save()) {
             $this->redirect(array('index'));
         }
     }
     $this->render('create', array('model' => $model));
 }
開發者ID:GKillah,項目名稱:social,代碼行數:17,代碼來源:ToolController.php

示例6: save

 public function save()
 {
     if ($this->loaded === FALSE) {
         $new_cat = ORM::factory('showroom_cat');
         $new_cat->showroom_id = $this->id;
         $new_cat->fk_site = $this->fk_site;
         $new_cat->name = 'ROOT';
         $new_cat->local_parent = 0;
         $new_cat->position = 0;
         $new_cat->save();
         $showroom->root_id = $new_cat->id;
     }
     return parent::save();
 }
開發者ID:plusjade,項目名稱:plusjade,代碼行數:14,代碼來源:showroom.php

示例7: save

 /**
  * Overload saving to set the created time and to create a new token
  * when the object is saved.
  */
 public function save()
 {
     if ($this->loaded === FALSE) {
         if ($sample) {
             $new_item = ORM::factory('calendar_item');
             $new_item->fk_site = $this->fk_site;
             $new_item->calendar_id = $this->id;
             $new_item->year = date("Y");
             $new_item->month = date("m");
             $new_item->day = date("d");
             $new_item->title = 'New Website Launch!';
             $new_item->desc = "Pizza party at my house to celebrate my new website launch. Starts at 3pm, bring your buddies!";
             $new_item->save();
         }
     }
     return parent::save();
 }
開發者ID:plusjade,項目名稱:plusjade,代碼行數:21,代碼來源:calendar.php

示例8: save

 public function save($sample = FALSE)
 {
     if ($this->loaded === FALSE) {
         $this->save();
         $new_item = ORM::factory('navigation_item');
         $new_item->navigation_id = $this->id;
         $new_item->fk_site = $this->fk_site;
         $new_item->display_name = 'ROOT';
         $new_item->type = 'none';
         $new_item->data = 0;
         $new_item->local_parent = 0;
         $new_item->save();
         $this->root_id = $new_item->id;
         if ($sample) {
             $new_item->clear();
             $new_item->navigation_id = $this->id;
             $new_item->fk_site = $this->fk_site;
             $new_item->display_name = 'Sample list item';
             $new_item->type = 'none';
             $new_item->data = '';
             $new_item->local_parent = $navigation->root_id;
             $new_item->save();
             $new_item->clear();
             $new_item->navigation_id = $this->id;
             $new_item->fk_site = $this->fk_site;
             $new_item->display_name = 'Link to Home';
             $new_item->type = 'page';
             $new_item->data = 'home';
             $new_item->local_parent = $navigation->root_id;
             $new_item->save();
             $new_item->clear();
             $new_item->navigation_id = $this->id;
             $new_item->fk_site = $this->fk_site;
             $new_item->display_name = 'External Google Link';
             $new_item->type = 'url';
             $new_item->data = 'google.com';
             $new_item->local_parent = $navigation->root_id;
             $new_item->save();
             # Update left and right values
             Tree::rebuild_tree('navigation_item', $navigation->root_id, $this->fk_site, '1');
         }
     }
     return parent::save();
 }
開發者ID:plusjade,項目名稱:plusjade,代碼行數:44,代碼來源:navigation.php

示例9: save

 /**
  * Overload saving to set the created time and to create a new token
  * when the object is saved.
  */
 public function save()
 {
     if ($this->loaded === FALSE) {
         if ($sample) {
             $new_post = ORM::factory('blog_post');
             $new_post->fk_site = $this->fk_site;
             $new_post->blog_id = $this->id;
             $new_post->url = 'my-first-blog-post';
             $new_post->title = 'My First Blog Post';
             $new_post->body = '<p>All sorts of interesting content...</p> And then some more content <p>Looking good!</p>';
             $new_post->created = strftime("%Y-%m-%d %H:%M:%S");
             $new_post->status = 'publish';
             $new_post->save();
             $db = Database::instance();
             $data = array('fk_site' => $this->fk_site, 'blog_post_id' => $new_post->id, 'blog_id' => $this->id, 'value' => 'general');
             $db->insert('blog_post_tags', $data);
         }
     }
     return parent::save();
 }
開發者ID:plusjade,項目名稱:plusjade,代碼行數:24,代碼來源:blog.php

示例10: save

 /**
  * Overload saving to set the created time and to create a new token
  * when the object is saved.
  */
 public function save()
 {
     if ($this->loaded === FALSE) {
     }
     return parent::save();
 }
開發者ID:plusjade,項目名稱:plusjade,代碼行數:10,代碼來源:account.php


注:本文中的Tool::save方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。