本文整理汇总了PHP中YumUser::findAll方法的典型用法代码示例。如果您正苦于以下问题:PHP YumUser::findAll方法的具体用法?PHP YumUser::findAll怎么用?PHP YumUser::findAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类YumUser
的用法示例。
在下文中一共展示了YumUser::findAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionprojectdetails
public function actionprojectdetails()
{
if (!empty(Yii::app()->user->_data)) {
$projectModel = new YumUserProject();
// get project id
$id = Yii::app()->request->getParam('project_id');
// here define the userdocumentsprojects as relation
$projectObj = $projectModel->with('projectresources')->findByPk($id);
$projectArr = [];
$projectArr['project'] = $projectObj;
//get project tasks
$projModel = new YumUserProject();
$projectTasks = $projModel->findAll('parent_id=:parent_id', array('parent_id' => $id));
if (!empty($projectTasks)) {
$projectArr['task'] = $projectTasks;
} else {
$projectArr['task'] = [];
}
$allUsersModel = new YumUser();
$allUsersObjs = $allUsersModel->findAll();
$this->render('projectdetails', array('projectdetails' => $projectArr, 'allUsers' => $allUsersObjs));
} else {
$this->redirect(array('//user/auth/login'));
}
}
示例2: listDocuments
public function listDocuments()
{
$model = new YumUserdocuments();
$allDocuments = $model->findAll();
Yii::import('user.models.*');
$userModel = new YumUser();
$allUsers = $userModel->findAll();
if (!empty($allDocuments)) {
$this->render('index', array('model' => $model, 'documents' => $allDocuments, 'allUsers' => $allUsers));
return;
} else {
$this->render('index', array('model' => $model, 'documents' => $allDocuments, 'allUsers' => $allUsers));
}
}