本文整理汇总了PHP中Domain::unsetAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP Domain::unsetAttributes方法的具体用法?PHP Domain::unsetAttributes怎么用?PHP Domain::unsetAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Domain
的用法示例。
在下文中一共展示了Domain::unsetAttributes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIndex
/**
* Lists all models.
*/
public function actionIndex()
{
$model = new Domain('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Domain'])) {
$model->attributes = $_GET['Domain'];
}
$userId = Yii::app()->user->getId();
$user = User::model()->findByPK($userId);
$this->render('index', array('model' => $model, 'user' => $user));
}
示例2: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$model = new Domain('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Domain'])) {
$model->attributes = $_GET['Domain'];
}
$this->render('admin', array('model' => $model));
}
示例3: actionDomain
public function actionDomain()
{
$application = new ApplicationDomainMentor();
$domains = new Domain();
if (Yii::app()->getRequest()->isPostRequest) {
$user = User::model()->getCurrentUser();
$application->attributes = $_POST['ApplicationDomainMentor'];
$application->status = 'Admin';
$application->user_id = $user->id;
$application->date_created = new CDbExpression('NOW()');
$application->save(false);
$picks = $_POST['domPicks'];
$picks = explode(',', $picks);
foreach ($picks as $pick) {
$dbpick = new ApplicationDomainMentorPick();
$dbpick->app_id = $application->id;
$temp = explode(':', $pick);
$dbpick->domain_id = $temp[0];
$dbpick->proficiency = $temp[1];
$dbpick->approval_status = 'Proposed by Mentor';
$dbpick->save(false);
}
$picks = $_POST['subPicks'];
if (isset($picks) && $picks != "") {
$picks = explode(',', $picks);
foreach ($picks as $pick) {
$dbpick = new ApplicationSubdomainMentorPick();
$dbpick->app_id = $application->id;
$temp = explode(':', $pick);
$dbpick->subdomain_id = $temp[0];
$dbpick->proficiency = $temp[1];
$dbpick->approval_status = 'Proposed by Mentor';
$dbpick->save(false);
}
}
$this->redirect("/coplat/index.php/application/portal");
} else {
// on initial load
$domains->unsetAttributes();
$domain = Domain::model()->getDomainsForApp($domains->searchNoPagination());
}
$error = '';
$this->render('domain', array('application' => $application, 'domain' => $domain, 'error' => $error));
}