• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP XoopsPersistableObjectHandler类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: delete

 /**
  * Delete an object from the database
  * @see XoopsPersistableObjectHandler
  *
  * @param profileRegstep $obj
  * @param bool $force
  *
  * @return bool
  */
 function delete($obj, $force = false)
 {
     if (parent::delete($obj, $force)) {
         $field_handler =& xoops_getmodulehandler('field');
         return $field_handler->updateAll('step_id', 0, new Criteria('step_id', $obj->getVar('step_id')));
     }
     return false;
 }
开发者ID:gauravsaxena21,项目名称:simantz,代码行数:17,代码来源:regstep.php


示例2: delete

 /**
  * Delete an object from the database
  * @see XoopsPersistableObjectHandler
  *
  * @param XoopsObject $obj
  * @param bool           $force
  *
  * @return bool
  */
 public function delete(XoopsObject $obj, $force = false)
 {
     if (parent::delete($obj, $force)) {
         $field_handler = xoops_getModuleHandler('field');
         return $field_handler->updateAll('step_id', 0, new Criteria('step_id', $obj->getVar('step_id')), $force);
     }
     return false;
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:17,代码来源:regstep.php


示例3: insert

 function insert(&$object, $force = true)
 {
     if ($ret = parent::insert($object, $force)) {
         $object->unsetNew();
     }
     return $ret;
 }
开发者ID:yunsite,项目名称:xoopsdc,代码行数:7,代码来源:object.php


示例4: countRelated

 public function countRelated($start = 0, $limit = 0, $sort = 'related_name', $order = 'ASC')
 {
     $criteria = new CriteriaCompo();
     $criteria->setSort($sort);
     $criteria->setOrder($order);
     $criteria->setStart($start);
     $criteria->setLimit($limit);
     return parent::getCount();
 }
开发者ID:RanLee,项目名称:XoopsCore,代码行数:9,代码来源:page_related.php


示例5: getCatIds

 function getCatIds($uids = null)
 {
     if ($uids == null) {
         return false;
     }
     $criteria = new CriteriaCompo();
     $criteria->add(new Criteria("uid", "(" . implode(", ", $uids) . ")", "in"), 'AND');
     $cats = parent::getAll($criteria, null, false);
     return $cats;
 }
开发者ID:yunsite,项目名称:xoopsdc,代码行数:10,代码来源:linkusers.php


示例6: getAllByFieldId

 /**
  * get all rows matching a condition
  *
  * @param  CriteriaElement $criteria  {@link CriteriaElement} to match
  *
  * @return array of row arrays, indexed by field_id
  */
 public function getAllByFieldId(CriteriaElement $criteria = null)
 {
     $rawRows = parent::getAll($criteria, null, false, false);
     usort($rawRows, array($this, 'visibilitySort'));
     $rows = array();
     foreach ($rawRows as $rawRow) {
         $rows[$rawRow['field_id']][] = $rawRow;
     }
     return $rows;
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:17,代码来源:visibility.php


示例7: delete

 function delete(&$category)
 {
     global $xoopsModule;
     $forum_handler =& xoops_getmodulehandler('forum', 'newbb');
     $forum_handler->deleteAll(new Criteria("cat_id", $category->getVar('cat_id')), true, true);
     if ($result = parent::delete($category)) {
         // Delete group permissions
         return $this->deletePermission($category);
     } else {
         $category->setErrors("delete category error: " . $sql);
         return false;
     }
 }
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:13,代码来源:category.php


示例8: getStats

 public function getStats($content_id)
 {
     $criteria = new CriteriaCompo();
     $criteria->add(new Criteria('rating_content_id', $content_id));
     $i = 0;
     $total = 0;
     $obj = parent::getAll($criteria);
     foreach ($obj as $k => $v) {
         ++$i;
         $total += $v->getVar('rating_rating');
     }
     return array('voters' => $i, 'average' => $total / $i);
 }
开发者ID:RanLee,项目名称:XoopsCore,代码行数:13,代码来源:page_rating.php


示例9:

 function __construct(&$db)
 {
     parent::__construct($db, "tdmcreate_modules", 'tdmcreate_modules', 'modules_id', 'modules_name');
 }
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:4,代码来源:tdmcreate_modules.php


示例10: deleteAllByStatus

 function deleteAllByStatus($status = MYINVITER_STATUS_WAITING)
 {
     $ret = parent::deleteAll(new Criteria('status', $status));
     return $ret;
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:5,代码来源:item.php


示例11: delete

 /**
  * delete an item from the database
  *
  * @param object $item reference to the ITEM to delete
  * @param bool   $force
  *
  * @return bool FALSE if failed.
  */
 public function delete(&$item, $force = false)
 {
     // Deleting the files
     if (!$this->publisher->getHandler('file')->deleteItemFiles($item)) {
         $item->setErrors('An error while deleting a file.');
     }
     if (!parent::delete($item, $force)) {
         $item->setErrors('An error while deleting.');
         return false;
     }
     // Removing tags information
     if (xoops_isActiveModule('tag')) {
         $tag_handler = xoops_getmodulehandler('tag', 'tag');
         $tag_handler->updateByItem('', $item->getVar('itemid'), PUBLISHER_DIRNAME, 0);
     }
     return true;
 }
开发者ID:RanLee,项目名称:Xoops_demo,代码行数:25,代码来源:item.php


示例12:

 function __construct(&$db)
 {
     parent::__construct($db, 'profile_visibility', 'profilevisibility', 'field_id');
 }
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:4,代码来源:visibility.php


示例13: array

 /**
  * retrieve categories from the database
  *
  * @param object $criteria {@link CriteriaElement} conditions to be met
  * @param bool   $idAsKey  use the categoryid as key for the array?
  *
  * @return array array of {@link XoopsItem} objects
  */
 public function &getObjects($criteria = null, $idAsKey = false)
 {
     $ret = array();
     $theObjects =& parent::getObjects($criteria, true);
     foreach ($theObjects as $theObject) {
         if (!$idAsKey) {
             $ret[] = $theObject;
         } else {
             $ret[$theObject->categoryid()] = $theObject;
         }
         unset($theObject);
     }
     return $ret;
 }
开发者ID:trabisdementia,项目名称:publisher,代码行数:22,代码来源:category.php


示例14: __construct

 public function __construct(\Xoops\Core\Database\Connection $db, $table = '', $className = '', $keyName = '', $identifierName = '')
 {
     parent::__construct($db, $table, $className, $keyName, $identifierName);
 }
开发者ID:RanLee,项目名称:XoopsCore,代码行数:4,代码来源:objectpersistableHandlerTest.php


示例15: __construct

 /**
  * @param null|XoopsDatabase $db
  */
 public function __construct(XoopsDatabase $db)
 {
     parent::__construct($db, 'profile_category', 'profilecategory', 'cat_id', 'cat_title');
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:7,代码来源:category.php


示例16: insert

 /**
  * insert a new object in the database
  *
  * @param object $obj reference to the object
  * @param bool $force whether to force the query execution despite security settings
  * @param bool $checkObject check if the object is dirty and clean the attributes
  *
  * @return bool FALSE if failed, TRUE if already present and unchanged or successful
  */
 function insert(&$obj, $force = false, $checkObject = true)
 {
     $uservars = $this->getUserVars();
     foreach ($uservars as $var) {
         unset($obj->vars[$var]);
     }
     if (count($obj->vars) == 0) {
         return true;
     }
     return parent::insert($obj, $force, $checkObject);
 }
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:20,代码来源:profile.php


示例17:

 function __construct($db)
 {
     parent::__construct($db, 'ranks', 'SystemUserrank', 'rank_id', 'rank_title');
 }
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:4,代码来源:userrank.php


示例18: setTodelete

 /**
  * Mark a message as to_delete = 1 or removes it if the sender has also deleted it or sent by anonymous
  *
  * @param XoopsObject|PmMessage $pm
  * @param int $val
  * @return bool
  */
 public function setTodelete(PmMessage $pm, $val = 1)
 {
     if ($pm->getVar('from_delete') == 0 && $pm->getVar('from_userid') == 0) {
         return $this->updateAll('to_delete', (int) $val, new Criteria('msg_id', $pm->getVar('msg_id')));
     } else {
         return parent::delete($pm);
     }
 }
开发者ID:RanLee,项目名称:XoopsCore,代码行数:15,代码来源:message.php


示例19:

 /**
  * @param null|object $db
  */
 function __construct($db)
 {
     parent::__construct($db, 'bannerfinish', 'SystemBannerFinish', 'bid', 'cid');
 }
开发者ID:RanLee,项目名称:Xoops_demo,代码行数:7,代码来源:bannerfinish.php


示例20: delete

 function delete(&$obj, $force = false)
 {
     $sql = sprintf("DELETE FROM %s WHERE block_id = %u", $this->db->prefix('block_module_link'), $obj->getVar('instanceid'));
     if ($this->db->query($sql)) {
         $groupperm_handler =& xoops_gethandler('groupperm');
         $criteria = new CriteriaCompo(new Criteria('gperm_modid', 1));
         $criteria->add(new Criteria('gperm_name', 'block_read'));
         $criteria->add(new Criteria('gperm_itemid', $obj->getVar('instanceid')));
         if ($groupperm_handler->deleteAll($criteria)) {
             return parent::delete($obj, $force);
         }
     }
     //@TODO: LOCALIZE
     $obj->setErrors("Could not delete instance link");
     return false;
 }
开发者ID:BackupTheBerlios,项目名称:xoops4-svn,代码行数:16,代码来源:blockinstance.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP XoopsThemeForm类代码示例发布时间:2022-05-23
下一篇:
PHP XoopsPageNav类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap