本文整理汇总了PHP中UserGroup::getUsers方法的典型用法代码示例。如果您正苦于以下问题:PHP UserGroup::getUsers方法的具体用法?PHP UserGroup::getUsers怎么用?PHP UserGroup::getUsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserGroup
的用法示例。
在下文中一共展示了UserGroup::getUsers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setGroup
/**
* Assign the user to a group
*
* @param Entity\UserGroup $group
* @return void
*/
public function setGroup(UserGroup $group)
{
$this->group = $group;
// The association must be defined in both directions
if (!$group->getUsers()->contains($this)) {
$group->addUser($this);
}
}
示例2: UserGroup
<?php
if (isset($_GET['userGroupID'])) {
$userGroupID = $_GET['userGroupID'];
} else {
$userGroupID = '';
}
$userGroup = new UserGroup(new NamedArguments(array('primaryKey' => $userGroupID)));
//get all users for output in drop down
$allUserArray = array();
$userObj = new User();
$allUserArray = $userObj->allAsArray();
//get users already set up for this user group in case it's an edit
$ugUserArray = $userGroup->getUsers();
?>
<div id='div_userGroupForm'>
<form id='userGroupForm'>
<input type='hidden' name='editUserGroupID' id='editUserGroupID' value='<?php
echo $userGroupID;
?>
'>
<div class='formTitle' style='width:280px; margin-bottom:5px;position:relative;'><span class='headerText'><?php
if ($userGroupID) {
echo _("Edit User Group");
} else {
echo _("Add User Group");
}
?>
</span></div>
示例3: foreach
</th>
<th><?php
echo _("Users");
?>
</th>
<th> </th>
<th> </th>
</tr>
<?php
foreach ($userGroupArray as $ug) {
$userGroup = new UserGroup(new NamedArguments(array('primaryKey' => $ug['userGroupID'])));
echo "<tr>";
echo "<td>" . $userGroup->groupName . "</td>";
echo "<td>" . $userGroup->emailAddress . "</td>";
echo "<td>";
foreach ($userGroup->getUsers() as $groupUser) {
echo $groupUser->getDisplayName . "<br />";
}
echo "</td>";
echo "<td><a href='ajax_forms.php?action=getAdminUserGroupForm&userGroupID=" . $userGroup->userGroupID . "&height=400&width=305&modal=true' class='thickbox'><img src='images/edit.gif' alt='" . _("edit") . "' title='" . _("edit") . "'></a></td>";
echo "<td><a href='javascript:deleteWorkflow(\"UserGroup\", " . $userGroup->userGroupID . ");'><img src='images/cross.gif' alt='" . _("remove") . "' title='" . _("remove") . "'></a></td>";
echo "</tr>";
}
?>
</table>
<?php
} else {
echo _("(none found)") . "<br />";
}
echo "<a href='ajax_forms.php?action=getAdminUserGroupForm&userGroupID=&height=400&width=305&modal=true' class='thickbox'>" . _("add user group") . "</a>";
?>