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


PHP xPDOSimpleObject::save方法代码示例

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


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

示例1: save

 public function save($cacheFlag = null)
 {
     if ($this->alias == '') {
         $this->set('alias', $this->generateUniqueAlias($this->name));
     }
     return parent::save($cacheFlag);
 }
开发者ID:hansek,项目名称:Tagger,代码行数:7,代码来源:taggergroup.class.php

示例2: save

 public function save($cacheFlag = null)
 {
     if (empty($this->key)) {
         $this->key = md5($this->id . time() . $this->dir_name);
     }
     return parent::save($cacheFlag);
 }
开发者ID:pixelfanatiker,项目名称:Git-Package-Management,代码行数:7,代码来源:gitpackage.class.php

示例3: save

 public function save($cacheFlag = null)
 {
     if ($isNew = $this->isNew()) {
         /*if(!$this->get('createdon')){
               $this->set('createdon', time());
           }
           
           if(!$this->get('createdby')){
               $this->set('createdby', $this->xpdo->user->id ? $this->xpdo->user->id : null);
           }*/
         $this->set('ip', $this->getUserIP());
     }
     if (!$this->get('parent')) {
         $this->set('parent', null);
     }
     /*
             Не делаем так, потому что иначе при обновлении дочерних комментов
             у нас все родительские комменты будут тоже обновленными
             else{
                 if(!$this->get('editedon')){
                     $this->set('editedon', time());
                 }
             }*/
     $rt = parent::save($cacheFlag);
     /*
         If saved and it`s was new comment, recalculate total comments
     */
     if ($rt && $isNew) {
         $this->recalculateParentComments(1);
     }
     return $rt;
 }
开发者ID:bendasvadim,项目名称:NewsModxBox,代码行数:32,代码来源:societycomment.class.php

示例4: save

 public function save($cacheFlag = NULL)
 {
     if (!$this->get('topicid') && empty($this->_relatedObjects['Topic']) or !$this->get('blogid') && empty($this->_relatedObjects['Blog'])) {
         return false;
     }
     return parent::save($cacheFlag);
 }
开发者ID:bendasvadim,项目名称:NewsModxBox,代码行数:7,代码来源:societyblogtopic.class.php

示例5: save

 public function save($cacheFlag = null)
 {
     $preventsave = $this->get('preventsave');
     $published = $this->get('published');
     $this->event = $this->getOne('Event');
     //handle enddate - enddate can't be lower than startdate
     $enddate = $this->get('enddate');
     $startdate = $this->get('startdate');
     if ($enddate <= $startdate) {
         $this->set('enddate', $startdate);
     }
     //handle allday
     $this->handleAllday();
     $active = true;
     if (empty($published)) {
         $active = false;
     }
     if ($active) {
         if (!$this->handleDouble()) {
             return true;
         }
         if (!$this->handleDoubleInAssignedCats()) {
             return true;
         }
     }
     if (!$preventsave) {
         return parent::save($cacheFlag);
     } else {
         return true;
     }
 }
开发者ID:Piterden,项目名称:modx_testfloor,代码行数:31,代码来源:migxcalendardates.class.php

示例6: save

 public function save($cacheFlag = null)
 {
     if ($this->isNew()) {
         $this->set('createdon', strftime('%Y-%m-%d %H:%M:%S'));
     }
     return parent::save($cacheFlag);
 }
开发者ID:raadhuis,项目名称:modx-basic,代码行数:7,代码来源:quipcommentnotify.class.php

示例7: save

 /**
  * Overrides xPDOObject::save to set the createdon date.
  *
  * {@inheritdoc}
  */
 public function save($cacheFlag = null)
 {
     if ($this->_new && !$this->get('created')) {
         $this->set('created', strftime('%Y-%m-%d %H:%M:%S'));
     }
     $saved = parent::save($cacheFlag);
     return $saved;
 }
开发者ID:JoeBlow,项目名称:revolution,代码行数:13,代码来源:modworkspace.class.php

示例8: save

 /**
  * Overrides xPDOObject::save to clear lexicon cache on saving.
  *
  * {@inheritdoc}
  */
 public function save($cacheFlag = null)
 {
     $saved = parent::save($cacheFlag);
     if ($saved && empty($this->xpdo->config[xPDO::OPT_SETUP])) {
         $this->clearCache();
     }
     return $saved;
 }
开发者ID:JoeBlow,项目名称:revolution,代码行数:13,代码来源:modlexicontopic.class.php

示例9: save

 public function save($cacheFlag = NULL)
 {
     if (!$this->get('resourceid')) {
         $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, "Resource ID is null");
         return false;
     }
     return parent::save($cacheFlag);
 }
开发者ID:bendasvadim,项目名称:NewsModxBox,代码行数:8,代码来源:societytopicattributes.class.php

示例10: save

 public function save($cacheFlag = null)
 {
     if (!$this->Source) {
         $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, 'Attempt to save object without MediaSource: ' . print_r($this->toArray('', true), 1));
         return false;
     }
     $this->path = $this->Source->getPath($this->path);
     return parent::save($cacheFlag);
 }
开发者ID:bendasvadim,项目名称:modx-Dropbox,代码行数:9,代码来源:dropboxobject.class.php

示例11: save

 public function save($cacheFlag = null)
 {
     $saved = parent::save($cacheFlag);
     if ($saved) {
         if ($this->xpdo->getCacheManager()) {
             $this->xpdo->cacheManager->delete('gallery/item/list/');
         }
     }
     return $saved;
 }
开发者ID:Piterden,项目名称:modx_testfloor,代码行数:10,代码来源:galtag.class.php

示例12: save

 public function save($cacheFlag = null)
 {
     if (!$this->checkDuplicate()) {
         $out = parent::save($cacheFlag);
     } else {
         $this->xpdo->log(xPDO::LOG_LEVEL_INFO, '[ThumbImages] Duplicate records for ' . $this->get('image') . ' with config ' . $this->config);
         $out = false;
     }
     return $out;
 }
开发者ID:gvozdb,项目名称:phpthumbon,代码行数:10,代码来源:thumbimages.class.php

示例13: save

 public function save($cacheFlag = null)
 {
     $update = $this->isDirty('active');
     $save = parent::save($cacheFlag);
     /** @var msdCouponGroup $group */
     if ($update && ($group = $this->getOne('Group'))) {
         $group->updateCounters();
     }
     return $save;
 }
开发者ID:bendasvadim,项目名称:msDiscount,代码行数:10,代码来源:msdcoupon.class.php

示例14: save

 /**
  * @param bool $cacheFlag
  * @return bool
  */
 public function save($cacheFlag = false)
 {
     $isNew = $this->isNew();
     if ($isNew) {
         $this->set('createdon', date('Y-m-d H:i:s'));
     } else {
         $this->set('updatedon', date('Y-m-d H:i:s'));
     }
     $saved = parent::save($cacheFlag);
     return $saved;
 }
开发者ID:vgrish,项目名称:staticcontent,代码行数:15,代码来源:sccontent.class.php

示例15: save

 /** 
  * Make sure the relations actually exist.
  */
 public function save($cacheFlag = null)
 {
     if (!($Asset = $this->xpdo->getObject('Asset', $this->get('asset_id')))) {
         $this->xpdo->log(\modX::LOG_LEVEL_ERROR, 'Invalid Asset ID: ' . $this->get('asset_id'), '', __CLASS__);
         throw new \Exception('Invalid Asset ID specified for PageAsset');
     }
     if (!($Page = $this->xpdo->getObject('modResource', $this->get('page_id')))) {
         $this->xpdo->log(\modX::LOG_LEVEL_ERROR, 'Invalid Page ID: ' . $this->get('page_id'), '', __CLASS__);
         throw new \Exception('Invalid Page ID specified for PageAsset');
     }
     return parent::save($cacheFlag);
 }
开发者ID:crecorn,项目名称:assetmanager,代码行数:15,代码来源:pageasset.class.php


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