當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。