当前位置: 首页>>代码示例>>PHP>>正文


PHP ActiveRecord::save方法代码示例

本文整理汇总了PHP中ActiveRecord::save方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveRecord::save方法的具体用法?PHP ActiveRecord::save怎么用?PHP ActiveRecord::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ActiveRecord的用法示例。


在下文中一共展示了ActiveRecord::save方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: save

 public function save($deep = true)
 {
     if (!$this->Key) {
         $this->Key = static::generateUniqueKey();
     }
     parent::save($deep);
 }
开发者ID:jmealo,项目名称:Gatekeeper,代码行数:7,代码来源:Key.php

示例2: save

 public function save($deep = true)
 {
     parent::save($deep);
     if (($this->isUpdated || $this->isNew) && $this->EndpointID) {
         Cache::delete("endpoints/{$this->EndpointID}/rewrites");
     }
 }
开发者ID:jmealo,项目名称:Gatekeeper,代码行数:7,代码来源:EndpointRewrite.php

示例3: save

 public function save($deep = true)
 {
     parent::save($deep);
     if (($this->isUpdated || $this->isNew) && $this->KeyID) {
         Cache::delete("keys/{$this->KeyID}/endpoints");
     }
 }
开发者ID:jmealo,项目名称:Gatekeeper,代码行数:7,代码来源:KeyEndpoint.php

示例4: save

 public function save($deep = true)
 {
     parent::save($deep);
     if ($this->isUpdated || $this->isNew) {
         Cache::delete('bans');
     }
 }
开发者ID:jmealo,项目名称:Gatekeeper,代码行数:7,代码来源:Ban.php

示例5: save

 public function save($deep = true)
 {
     // set handle
     if (!$this->Handle) {
         $this->Handle = strtolower(static::getUniqueHandle($this->Title));
     }
     return parent::save($deep);
 }
开发者ID:nbey,项目名称:Emergence-Skeleton,代码行数:8,代码来源:Category.class.php

示例6: save

 public function save($new = false, $primary = 'id')
 {
     if (parent::save($new, $primary)) {
         $_SESSION['usr']['upd'] = 1;
         return true;
     } else {
         return false;
     }
 }
开发者ID:helloris25,项目名称:mvc,代码行数:9,代码来源:users.php

示例7: save

 public function save()
 {
     // set handle
     if (!$this->Handle) {
         $this->Handle = static::getUniqueHandle($this->Title);
     }
     // call parent
     parent::save();
 }
开发者ID:nbey,项目名称:Emergence-Skeleton,代码行数:9,代码来源:Forum.class.php

示例8: save

 public function save($deep = true)
 {
     // set code
     if (!$this->Code) {
         $this->Code = \HandleBehavior::getUniqueHandle($this, $this->Title, ['handleField' => 'Code']);
     }
     // call parent
     parent::save($deep);
 }
开发者ID:aharley40,项目名称:slate-cbl,代码行数:9,代码来源:ContentArea.php

示例9: save

 public function save($deep = true)
 {
     if (!$this->Opened) {
         $this->Opened = time();
     }
     if ($this->isFieldDirty('Status') && $this->Status == 'closed' && !$this->Closed) {
         $this->Closed = time();
     }
     parent::save($deep);
 }
开发者ID:jmealo,项目名称:Gatekeeper,代码行数:10,代码来源:AbstractAlert.php

示例10: saveModel

 protected function saveModel(ActiveRecord $model, $web_url)
 {
     if ($model->save()) {
         $model->grabImages($web_url);
         $model->grabTagsFromText();
         $this->log("Сохранена модель #{$model->id}");
     } else {
         $this->log("Не могу сохранить модель: ", impode("<br/>", $model->errors_flat_array));
     }
     return $model;
 }
开发者ID:blindest,项目名称:Yii-CMS-2.0,代码行数:11,代码来源:OsParser.php

示例11: save

 public function save($deep = true)
 {
     // set handle
     if (!$this->Handle) {
         $this->Handle = HandleBehavior::generateRandomHandle($this);
     }
     if (!$this->Expires) {
         $this->Expires = time() + 3600 * static::$expirationHours;
     }
     // call parent
     parent::save($deep);
 }
开发者ID:nbey,项目名称:Emergence-Skeleton,代码行数:12,代码来源:Token.class.php

示例12: save

 public function save($deep = true)
 {
     // set handle
     if (!$this->Handle) {
         $this->Handle = HandleBehavior::generateRandomHandle($this, 4);
     }
     // update PK
     if (!$this->ContextID && $this->Context && !$this->Context->isPhantom) {
         $this->ContextID = $this->Context->ID;
     }
     // call parent
     parent::save($deep);
 }
开发者ID:nbey,项目名称:Emergence-Skeleton,代码行数:13,代码来源:GlobalHandle.class.php

示例13: save

 public function save($forceOperation = null)
 {
     $this->executePlugins($this, 'before-save');
     if ($this instanceof EavAble && $this->eavObject->get() && !$this->eavObject->get()->getID() && $this->isSpecificationLoaded() && $this->getSpecification()->hasValues()) {
         $eavObject = $this->eavObject->get();
         $this->eavObject->setNull();
     }
     $res = parent::save($forceOperation);
     if (isset($eavObject)) {
         $eavObject->save();
         $this->eavObject->set($eavObject);
         $this->save();
     }
     if ($this instanceof EavAble && $this->specificationInstance && $this->eavObject->get()) {
         if ($this->specificationInstance->hasValues()) {
             $this->specificationInstance->save();
         } else {
             $this->eavObject->get()->delete();
         }
     }
     $this->executePlugins($this, 'after-save');
     return $res;
 }
开发者ID:saiber,项目名称:www,代码行数:23,代码来源:ActiveRecordModel.php

示例14: save

 public function save($deep = true)
 {
     HandleBehavior::onSave($this, $this->Headline);
     parent::save($deep);
 }
开发者ID:Sun-Wukong,项目名称:laddr,代码行数:5,代码来源:ProjectBuzz.php

示例15: ActiveRecord

<?php

require_once 'activerecord.php';
$ar = new ActiveRecord();
$ar->connectPdo('blogdb', 'blog', $_POST['username'], $_POST['password']);
$postid = $ar->size() + 1;
$ar->pagenum = $postid;
$ar->author = $_POST['username'];
$ar->date = date('Y/m/d');
$ar->title = $_POST['title'];
$ar->text = nl2br($_POST['text']);
try {
    $ar->save();
} catch (Exception $e) {
    echo $e->getMessage();
    return;
}
$ar->connectPdo('blogdb', 'categorytable', $_POST['username'], $_POST['password']);
$categories = explode(',', $_POST["category"]);
foreach ($categories as $category) {
    $ar->postid = $postid;
    $ar->category = $category;
    try {
        $ar->save();
    } catch (Exception $e) {
        echo $e->getMessage();
        $ar->connectPdo('blogdb', 'blog', $_POST['username'], $_POST['password']);
        $postid = $ar->size();
        $ar->delete($postid);
        return;
    }
开发者ID:pakutoma,项目名称:pakutomablog,代码行数:31,代码来源:post.php


注:本文中的ActiveRecord::save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。