本文整理汇总了PHP中Planning::findByAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP Planning::findByAttributes方法的具体用法?PHP Planning::findByAttributes怎么用?PHP Planning::findByAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Planning
的用法示例。
在下文中一共展示了Planning::findByAttributes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionEditcandidate
public function actionEditcandidate()
{
$candidateID = Yii::app()->request->getParam('id');
$candidateModel = new Candidate();
$planningModel = new Planning();
$UserProfile = new UserProfile();
$editCandidate = $candidateModel->with('plannings')->findByPk($candidateID);
$editPlanning = $planningModel->findByAttributes(array('CandidateID' => $candidateID));
if (isset($_POST['Candidate'])) {
$editCandidate->attributes = $_POST['Candidate'];
$editCandidate->CandidateID = $candidateID;
//$editCandidate->UserProfileID = Yii::app()->user->userProfileID;
$editCandidate->CompanyID = Yii::app()->user->companyID;
//$candidateModel->IsActive = 1;
$editPlanning->CurrentPositionLevel = $editCandidate->CompanyPositionID;
if ($editCandidate->validate()) {
if ($editCandidate->save()) {
$editPlanning->save();
$this->redirect(Yii::app()->createUrl('company/fullcandidates'));
}
}
}
$criteria3 = new CDbCriteria();
$criteria3->condition = '(companyID = :companyID AND IsActive=1)';
$criteria3->params = array(':companyID' => Yii::app()->user->companyID);
$criteria3->order = 'Email';
$userManagers = UserProfile::model()->with('userLogin')->findAllByAttributes(array(), $criteria3);
$managersArray = array();
foreach ($userManagers as $UserManager) {
$managersArray[$UserManager->UserProfileID] = $UserManager->Email;
}
$managerArray = $managersArray;
$companyPositions = Helper::getCompanyPositions(Yii::app()->user->companyID);
$this->render('candidate-form', array('candidateModel' => $editCandidate, 'planningModel' => $planningModel, 'companyPositionSelect' => $companyPositions, 'managerArray' => $managerArray));
}