本文整理匯總了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;
}
}