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


PHP UserListFactory::getByCompanyIdAndGroupId方法代码示例

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


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

示例1: postSave

 function postSave()
 {
     $this->StartTransaction();
     $this->getFastTreeObject()->setTree($this->getCompany());
     if ($this->getDeleted() == TRUE) {
         //FIXME: Get parent of this object, and re-parent all groups to it.
         $parent_id = $this->getFastTreeObject()->getParentId($this->getId());
         //Get items by group id.
         $ulf = new UserListFactory();
         $ulf->getByCompanyIdAndGroupId($this->getCompany(), $this->getId());
         if ($ulf->getRecordCount() > 0) {
             foreach ($ulf as $obj) {
                 Debug::Text(' Re-Grouping Item: ' . $obj->getId(), __FILE__, __LINE__, __METHOD__, 10);
                 $obj->setGroup($parent_id);
                 $obj->Save();
             }
         }
         $this->getFastTreeObject()->delete($this->getId());
         $this->CommitTransaction();
         return TRUE;
     } else {
         $retval = TRUE;
         //if ( $this->getId() === FALSE ) {
         if ($this->insert_tree === TRUE) {
             Debug::Text(' Adding Node ', __FILE__, __LINE__, __METHOD__, 10);
             //echo "Current ID: ".  $this->getID() ."<br>\n";
             //echo "Parent ID: ".  $this->getParent() ."<br>\n";
             //Add node to tree
             if ($this->getFastTreeObject()->add($this->getID(), $this->getParent()) === FALSE) {
                 Debug::Text(' Failed adding Node ', __FILE__, __LINE__, __METHOD__, 10);
                 $this->Validator->isTrue('name', FALSE, TTi18n::gettext('Name is already in use'));
                 $retval = FALSE;
             }
         } else {
             Debug::Text(' Editing Node ', __FILE__, __LINE__, __METHOD__, 10);
             //Edit node.
             $retval = $this->getFastTreeObject()->move($this->getID(), $this->getParent());
         }
         if ($retval === TRUE) {
             $this->CommitTransaction();
         } else {
             $this->FailTransaction();
         }
         return $retval;
     }
 }
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:46,代码来源:UserGroupFactory.class.php


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