本文整理汇总了PHP中Role::setLabel方法的典型用法代码示例。如果您正苦于以下问题:PHP Role::setLabel方法的具体用法?PHP Role::setLabel怎么用?PHP Role::setLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Role
的用法示例。
在下文中一共展示了Role::setLabel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: factory
public static function factory(Storage $storage, $row)
{
$role = new Role($storage);
$role->setRoleID($row["roleid"]);
$role->setLabel($row["label"]);
$role->setDescription($row["description"]);
return $role;
}
示例2: parseRoleFormular
function parseRoleFormular($session, &$role = null)
{
$label = $session->getVariable("label");
$description = $session->getVariable("description");
if ($role == null) {
$role = new Role($session->getStorage());
}
$role->setLabel($label);
$role->setDescription($description);
$role->save();
}
示例3: setLabel
public function setLabel($label)
{
$this->__load();
return parent::setLabel($label);
}
示例4: initRoles
function initRoles()
{
$roleFunctionViewFund = new Rolefunction();
$roleFunctionViewFund->setName("VIEW_FUND");
$this->em->persist($roleFunctionViewFund);
$roleFunctionAddFund = new Rolefunction();
$roleFunctionAddFund->setName("ADD_FUND");
$this->em->persist($roleFunctionAddFund);
$roleFunctionAddProject = new Rolefunction();
$roleFunctionAddProject->setName("ADD_PROJECT");
$this->em->persist($roleFunctionAddProject);
$roleFunctionViewTechSanction = new Rolefunction();
$roleFunctionViewTechSanction->setName("VIEW_TECH_SANCTION");
$this->em->persist($roleFunctionViewTechSanction);
$roleFunctionViewTechSanctionApprove = new Rolefunction();
$roleFunctionViewTechSanctionApprove->setName("APPROVE_TECH_SANCTION");
$this->em->persist($roleFunctionViewTechSanctionApprove);
$roleFunctionTenderView = new Rolefunction();
$roleFunctionTenderView->setName("VIEW_TENDER");
$this->em->persist($roleFunctionTenderView);
$roleFunctionTenderApprove = new Rolefunction();
$roleFunctionTenderApprove->setName("APPROVE_TENDER");
$this->em->persist($roleFunctionTenderApprove);
$roleFunctionWorkOrderView = new Rolefunction();
$roleFunctionWorkOrderView->setName("VIEW_WORK_ORDER");
$this->em->persist($roleFunctionWorkOrderView);
$roleFunctionWorkOrderApprove = new Rolefunction();
$roleFunctionWorkOrderApprove->setName("APPROVE_WORK_ORDER");
$this->em->persist($roleFunctionWorkOrderApprove);
$roleFunctionBillView = new Rolefunction();
$roleFunctionBillView->setName("VIEW_BILL");
$this->em->persist($roleFunctionBillView);
$roleFunctionBillApprove = new Rolefunction();
$roleFunctionBillApprove->setName("APPROVE_BILL");
$this->em->persist($roleFunctionBillApprove);
$roleFunctionCompleteView = new Rolefunction();
$roleFunctionCompleteView->setName("VIEW_COMPLETED");
$this->em->persist($roleFunctionCompleteView);
$roleFunctionManageContractor = new Rolefunction();
$roleFunctionManageContractor->setName("MANAGE_CONTRACTOR");
$this->em->persist($roleFunctionManageContractor);
$roleFunctionManageUser = new Rolefunction();
$roleFunctionManageUser->setName("MANAGE_USER");
$this->em->persist($roleFunctionManageUser);
$roleFunctionAdminApproval = new Rolefunction();
$roleFunctionAdminApproval->setName("VIEW_ADMIN_APPROVAL");
$this->em->persist($roleFunctionAdminApproval);
//Adding Roles
$admin = new Role();
$admin->setName("ADMIN");
$admin->setLabel("Administrator");
$admin->getRoleFunction()->add($roleFunctionViewFund);
$admin->getRoleFunction()->add($roleFunctionAddFund);
$admin->getRoleFunction()->add($roleFunctionAddProject);
$admin->getRoleFunction()->add($roleFunctionViewTechSanction);
$admin->getRoleFunction()->add($roleFunctionViewTechSanctionApprove);
$admin->getRoleFunction()->add($roleFunctionTenderView);
$admin->getRoleFunction()->add($roleFunctionTenderApprove);
$admin->getRoleFunction()->add($roleFunctionWorkOrderView);
$admin->getRoleFunction()->add($roleFunctionWorkOrderApprove);
$admin->getRoleFunction()->add($roleFunctionBillView);
$admin->getRoleFunction()->add($roleFunctionBillApprove);
$admin->getRoleFunction()->add($roleFunctionCompleteView);
$admin->getRoleFunction()->add($roleFunctionManageContractor);
$admin->getRoleFunction()->add($roleFunctionManageUser);
$admin->getRoleFunction()->add($roleFunctionAdminApproval);
$this->em->persist($admin);
$technical = new Role();
$technical->setName("TECHNICAL");
$technical->setLabel("Technical Approval");
$technical->getRoleFunction()->add($roleFunctionViewTechSanction);
$technical->getRoleFunction()->add($roleFunctionViewTechSanctionApprove);
$this->em->persist($technical);
$tendor = new Role();
$tendor->setName("TENDOR");
$tendor->setLabel("Tendor Approval");
$tendor->getRoleFunction()->add($roleFunctionTenderView);
$tendor->getRoleFunction()->add($roleFunctionTenderApprove);
$tendor->getRoleFunction()->add($roleFunctionManageContractor);
$this->em->persist($tendor);
$deptEngineer = new Role();
$deptEngineer->setName("DEPT_ENGINEER");
$deptEngineer->setLabel("Dept. Engineer");
$deptEngineer->getRoleFunction()->add($roleFunctionWorkOrderView);
$deptEngineer->getRoleFunction()->add($roleFunctionWorkOrderApprove);
$deptEngineer->getRoleFunction()->add($roleFunctionCompleteView);
$deptEngineer->getRoleFunction()->add($roleFunctionBillView);
$this->em->persist($deptEngineer);
$this->em->flush();
echo "Roles Created..!";
}