本文整理汇总了PHP中Role::setDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP Role::setDescription方法的具体用法?PHP Role::setDescription怎么用?PHP Role::setDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Role
的用法示例。
在下文中一共展示了Role::setDescription方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: executeProcessNewOrgRoleForm
public function executeProcessNewOrgRoleForm(sfWebRequest $request)
{
$o = Doctrine::getTable('Organization')->find($request->getParameter('id'));
$this->forward404Unless($o->isMy());
$r = new Role();
$r->setName($request->getParameter("name"));
$r->setOrganizationId($o->getId());
$r->setDescription($request->getParameter("description"));
$r->save();
$this->redirect("show/index?id=" . $o->getId());
}
示例4: insertRole
function insertRole($data)
{
$connection = connect();
$role = new Role();
echo dump($data);
$role->setRole(mysqli_real_escape_string($connection, $data['role']));
$role->setDescription(mysqli_real_escape_string($connection, $data['description']));
$query = "insert into role (";
$query .= " role,description ";
$query .= ") values( ";
$query .= " '{$role->getRole()}','{$role->getDescription()}'";
$query .= ")";
$result = mysqli_query($connection, $query);
if ($result) {
$id = mysqli_insert_id($connection);
return $id;
}
colse_connection($connection);
return null;
}
示例5: setDescription
public function setDescription($description)
{
$this->_load();
return parent::setDescription($description);
}
示例6: executeAddRole
/**
* Function adds a role to database
*
* @param sfWebRequest $request
* @return <type>
*/
public function executeAddRole(sfWebRequest $request) {
$data = $request->getPostParameters();
if(count($data) > 2) { // some rights are set
unset($data['userrole_title_name']);
unset($data['hiddenfield']);
$values = array_keys($data);
$roleObj = new Role();
$roleObj->setDescription($request->getParameter('userrole_title_name'));
$roleObj->save();
$id = $roleObj->getId();
foreach($values as $item) {
$rolecredObj = new CredentialRole();
$rolecredObj->setRoleId($id);
$rolecredObj->setCredentialId($item);
$rolecredObj->save();
}
}
else { // Only Userrole is written in textfield, nothing else
$obj = new Role();
$obj->setDescription($request->getParameter('userrole_title_name'));
$obj->save();
}
$this->renderText('{success:true}');
return sfView::NONE;
}