本文整理汇总了PHP中Scalr_Environment::getTeams方法的典型用法代码示例。如果您正苦于以下问题:PHP Scalr_Environment::getTeams方法的具体用法?PHP Scalr_Environment::getTeams怎么用?PHP Scalr_Environment::getTeams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scalr_Environment
的用法示例。
在下文中一共展示了Scalr_Environment::getTeams方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: viewAction
public function viewAction()
{
$users = array();
foreach ($this->env->getTeams() as $teamId) {
$team = Scalr_Account_Team::init()->loadById($teamId);
foreach ($team->getUsers() as $user) {
if (!isset($users[$user['id']])) {
$users[$user['id']] = array('id' => $user['id'], 'name' => !empty($user['fullname']) ? $user['fullname'] : $user['email'], 'email' => $user['email'], 'teams' => array());
}
$users[$user['id']]['teams'][] = array('id' => $team->id, 'name' => $team->name);
}
}
$this->response->page('ui/account2/environments/accessmap.js', array('definitions' => Acl::getResources(true), 'users' => array_values($users), 'env' => array('id' => $this->env->id, 'name' => $this->env->name)));
}