/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $model = new AclTipoUsuarioRota(); if (isset($_POST['AclTipoUsuarioRota'])) { $model->attributes = $_POST['AclTipoUsuarioRota']; if ($model->save()) { $this->redirect(array('view', 'id' => $model->id)); } } $this->render('create', array('model' => $model)); }
public function actionSetarRotaAdmin() { $oRotas = AclRota::model()->findAll(); foreach ($oRotas as $rota) { $oTipoUsuarioRota = new AclTipoUsuarioRota(); $oTipoUsuarioRota->acl_rota_id = $rota->id; $oTipoUsuarioRota->acl_tipo_usuario_id = 1; $oTipoUsuarioRota->save(); } }