model() public static method

Returns the static model of the specified AR class.
public static model ( $className = __CLASS__ ) : Audit
return Audit the static model class
Example #1
0
 protected function cleanUpTestUser()
 {
     if (!$this->user) {
         $this->user = User::model()->findByAttributes(array('username' => 'autotestapi'));
         if (!$this->user) {
             return;
         }
     }
     // clear out all the data we've touched, and the user
     foreach (array_merge(array('Audit', 'OEModule\\PASAPI\\models\\PasApiAssignment', 'Patient', 'Address', 'Contact'), $this->additional_clean_up_models) as $cls) {
         $cls::model()->deleteAllByAttributes(array('created_user_id' => $this->user->id));
     }
     Audit::model()->deleteAllByAttributes(array('user_id' => $this->user->id));
     $this->user->saveRoles(array());
     $this->user->delete();
 }
Example #2
0
 public function actionUpdateList()
 {
     if (!($audit = Audit::model()->findByPk(@$_GET['last_id']))) {
         throw new Exception('Log entry not found: ' . @$_GET['last_id']);
     }
     $this->renderPartial('_list_update', array('data' => $this->getData(null, $audit->id)), false, true);
 }
Example #3
0
 /**
  * @covers Audit::model
  */
 public function testModel()
 {
     $this->assertEquals('Audit', get_class(Audit::model()), 'Class name should match model.');
 }