OEModule\PASAPI\models\XpathRemap::model PHP Method

model() public static method

Returns the static model of the specified AR class.
public static model ( $className = __CLASS__ ) : PasApiAssignment
return PasApiAssignment the static model class
    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }

Usage Example

Example #1
0
 public function actionCreateRemapValue($id)
 {
     if (!($remap = XpathRemap::model()->findByPk($id))) {
         throw new \CHttpException('404', 'Could not Xpath Remap');
     }
     $model = new RemapValue();
     $model->xpath_id = $remap->id;
     if (isset($_POST[\CHtml::modelName($model)])) {
         $model->attributes = $_POST[\CHtml::modelName($model)];
         if ($model->save()) {
             \Audit::add('admin', 'create', serialize($model->attributes), false, array('module' => 'PASAPI', 'model' => '\\OEModule\\PASAPI\\models\\RemapValue'));
             \Yii::app()->user->setFlash('success', 'Remap Value added to ' . $remap->name);
             $this->redirect(array('viewRemapValues', 'id' => $id));
         }
     }
     $this->render('update', array('model' => $model, 'title' => 'Add Xpath Remap', 'cancel_uri' => \Yii::app()->createUrl($this->module->getName() . '/admin/viewRemapValues', array('id' => $remap->id))));
 }
All Usage Examples Of OEModule\PASAPI\models\XpathRemap::model