本文整理匯總了PHP中Group::setDescription方法的典型用法代碼示例。如果您正苦於以下問題:PHP Group::setDescription方法的具體用法?PHP Group::setDescription怎麽用?PHP Group::setDescription使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Group
的用法示例。
在下文中一共展示了Group::setDescription方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: buildSecurityGroup
/**
* @param string $title
* @return ISecurityGroup
*/
public function buildSecurityGroup($title)
{
$g = new Group();
$g->setTitle($title);
$g->setDescription($title);
$g->setSlug(str_replace(' ', '-', strtolower($title)));
return $g;
}
示例2: doUp
function doUp()
{
global $database;
$members = array(1368, 270, 9202);
// EdgarMagana, JonProulx, ShillaSaebi
$group = new Group();
$group->setTitle('User Committee');
$group->setDescription('User Committee');
$group->setSlug('user-committee');
$group->write();
$group->Members()->setByIDList($members);
}
示例3: createGroup
/**
* Create a new group
* @return void
*/
private function createGroup()
{
if (isset($_POST) && is_array($_POST) && count($_POST) > 0) {
require_once FRAMEWORK_PATH . 'models/group.php';
$group = new Group($this->registry, 0);
$group->setCreator($this->registry->getObject('authenticate')->getUser()->getUserID());
$group->setName($this->registry->getObject('db')->sanitizeData($_POST['name']));
$group->setDescription($this->registry->getObject('db')->sanitizeData($_POST['description']));
$group->setType($_POST['type']);
$group->save();
$this->registry->errorPage('Group created', 'Thank you, your new group has been created');
} else {
$this->registry->getObject('template')->buildFromTemplates('header.tpl.php', 'groups/create.tpl.php', 'footer.tpl.php');
}
}
示例4: up
function up()
{
echo "Starting Migration Proc ...<BR>";
//check if migration already had ran ...
$migration = DataObject::get_one("Migration", "Name='{$this->title}'");
if (!$migration) {
$g = new Group();
$g->setTitle('Community Members');
$g->setDescription('Community Members');
$g->setSlug(IFoundationMember::CommunityMemberGroupSlug);
$g->write();
$migration = new Migration();
$migration->Name = $this->title;
$migration->Description = $this->description;
$migration->Write();
}
echo "Ending Migration Proc ...<BR>";
}
示例5: up
function up()
{
echo "Starting Migration Proc ...<BR>";
//check if migration already had ran ...
$migration = Migration::get()->filter('Name', $this->title)->first();
if (!$migration) {
$g = new Group();
$g->setTitle('CCLA Admin');
$g->setDescription('Company CCLA Admin');
$g->setSlug(ICLAMemberDecorator::CCLAGroupSlug);
$g->write();
Permission::grant($g->getIdentifier(), ICLAMemberDecorator::CCLAPermissionSlug);
$migration = new Migration();
$migration->Name = $this->title;
$migration->Description = $this->description;
$migration->Write();
}
echo "Ending Migration Proc ...<BR>";
}
示例6: body
protected function body()
{
$inputs = array('lecture' => 'isIndex', 'name' => 'isNotEmpty', 'description' => array());
if (!$this->isInputValid($inputs)) {
return false;
}
$lectureIndex = $this->getParams('lecture');
$groupName = $this->getParams('name');
$groupDescription = $this->getParams('description');
$public = $this->paramExists('public') ? 'public' : 'private';
$groupId = $this->getParams('id');
$editing = $groupId !== null && $groupId !== '';
$user = User::instance();
/** @var \Lecture $lecture */
$lecture = Repositories::findEntity(Repositories::Lecture, $lectureIndex);
if ($editing) {
/**
* @var $group \Group
*/
$group = Repositories::findEntity(Repositories::Group, $groupId);
$group->setName($groupName);
$group->setDescription($groupDescription);
$group->setType($public);
Repositories::persistAndFlush($group);
} else {
if (!$this->userHasPrivileges(User::groupsAdd)) {
return $this->death(StringID::InsufficientPrivileges);
}
$group = new \Group();
$group->setDeleted(false);
$group->setDescription($groupDescription);
$group->setLecture($lecture);
$group->setName($groupName);
$group->setOwner($user->getEntity());
$group->setType($public);
Repositories::persistAndFlush($group);
}
return true;
}
示例7: find
function find($criteria = null, $order = null, $limit = 1000, $from = 0)
{
$result = $this->database->query($this->buildFindQuery($criteria, $order, $limit, $from));
if (!is_null($result->getError())) {
return $result->getError();
}
$groups = array();
while ($row = $result->fetchRow()) {
$group = new Group();
$value = $row[0];
$group->setId($value);
$value = $row[1];
$group->setOwner($value);
$value = $row[2];
$group->setName($value);
$value = $row[3];
$group->setDescription($value);
$value = $row[4];
$group->setPeriod_from($value);
$value = $row[5];
$group->setPeriod_to($value);
$value = $row[6];
$group->setProjects($value);
$value = $row[7];
$group->setR_date($value);
$value = $row[8];
$group->setR_user($value);
if ($order != null) {
array_push($groups, $group);
} else {
$groups[$group->getId()] = $group;
}
}
return $groups;
}
示例8: actionSaveGroup
function actionSaveGroup($currentUser)
{
$backUrl = $this->context->getFlowScopeAttr("backUrl");
$group = new Group();
$groupErrs = array();
$group->setId($this->context->getRequestAttr("id"));
$group->setName($this->context->getRequestAttr("name"));
if (!is_null($group->getName())) {
$group->setName(trim($group->getName()));
if (strlen($group->getName()) < 1) {
$group->setName(null);
}
}
if (is_null($group->getName())) {
$groupErrs["name"] = "field.error.empty";
}
$group->setDescription($this->context->getRequestAttr("description"));
if (!is_null($group->getDescription())) {
$group->setDescription(trim($group->getDescription()));
if (strlen($group->getDescription()) < 1) {
$group->setDescription(null);
}
}
$projects = $this->context->getRequestAttr("projects");
if (!is_null($projects)) {
$projects = json_encode($projects);
$group->setProjects($projects);
} else {
$group->setProjects(json_encode(array()));
}
$timeZone = new DateTimeZone("Europe/Vilnius");
$time = new DateTime("now", $timeZone);
$group->setOwner($currentUser->getId());
$group->setR_date($time->format("Y-m-d H:i:s"));
$group->setR_user($currentUser->getId());
$this->context->setFlashScopeAttr("group", $group);
$this->context->setFlashScopeAttr("groupErrs", $groupErrs);
if (count($groupErrs) >= 1) {
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
$store = $this->storeGroup($group);
if (!$store) {
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
$this->context->setRequestScopeAttr("success", "groups.success.stored");
$this->context->setFlashScopeAttr("viewGroup", $group);
$this->cancelGroupEdit();
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}