Allergy::model PHP Method

model() public static method

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

Usage Example

 /**
  * @covers BaseActiveRecord::save
  * @todo   Implement testSave().
  */
 public function testSave()
 {
     //using allergy model to test the active record
     $testmodel = new Allergy();
     $testmodel->setAttributes($this->testattributes);
     $testmodel->save();
     $result = Allergy::model()->findByAttributes(array('name' => 'allergy test'))->getAttributes();
     $expected = $this->testattributes;
     $this->assertEquals($expected['name'], $result['name'], 'attribute match');
 }
All Usage Examples Of Allergy::model