本文整理汇总了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;
}
}