本文整理匯總了PHP中UserInfo::getAllAdmins方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserInfo::getAllAdmins方法的具體用法?PHP UserInfo::getAllAdmins怎麽用?PHP UserInfo::getAllAdmins使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserInfo
的用法示例。
在下文中一共展示了UserInfo::getAllAdmins方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: handleOnApplied
/**
* 申請發布事件
* @param unknown_type $event
*/
public function handleOnApplied($event)
{
$owner = $this->getOwner();
$admins = UserInfo::getAllAdmins();
foreach ($admins as $user) {
Notice::send($user->id, 'entity_applied', array('entityId' => $owner->entityId));
}
}
示例2: actionCreate
/**
* 創建小組頁麵和處理
*/
public function actionCreate()
{
$model = new Group();
if (isset($_POST['Group'])) {
$model->attributes = $_POST['Group'];
$model->addTime = time();
$model->userId = Yii::app()->user->id;
$model->status = "apply";
if ($model->save()) {
// $model->addMember(Yii::app()->user->id,array('superAdmin'));
$member = new GroupMember();
$member->groupId = $model->id;
$member->userId = Yii::app()->user->id;
$member->setArrRoles(array('superAdmin'));
$member->save();
$admins = UserInfo::getAllAdmins();
foreach ($admins as $user) {
Notice::send($user->id, 'group_apply', array('groupId' => $model->getPrimaryKey()));
}
Yii::app()->user->setFlash('success', '申請已提交,請繼續完善小組資料');
$this->redirect(array('view', 'id' => $model->id));
}
}
$user = UserInfo::model()->findByPk(Yii::app()->user->id);
$this->render('create', array('model' => $model, 'user' => $user));
}