本文整理汇总了PHP中Role::getDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP Role::getDescription方法的具体用法?PHP Role::getDescription怎么用?PHP Role::getDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Role
的用法示例。
在下文中一共展示了Role::getDescription方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: getDescription
public function getDescription()
{
$this->_load();
return parent::getDescription();
}
示例3: addRole
public function addRole(Role $inRole)
{
// check permissions
if (!PermissionEngine::getInstance()->currentUserCanDo('userCanCreateRoles')) {
return false;
}
$db = Database::getInstance();
if (!$db->isConnected()) {
return false;
}
$roleName = $db->escapeString($inRole->getName());
$roleDesc = $db->escapeString($inRole->getDescription());
if ($roleDesc === '') {
$results = $db->insertData('role', 'roleName', '\'' . $roleName . '\'');
} else {
$results = $db->insertData('role', 'roleName, description', '\'' . $roleName . '\',\'' . $roleDesc . '\'');
}
if (!$results) {
return false;
}
return true;
}