OphTrLaser_Site_Laser::model PHP Méthode

model() public static méthode

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

Usage Example

 /**
  * sets up some javascript variables for use in the editing views.
  */
 protected function _jsCreate()
 {
     $eventId = Yii::app()->getRequest()->getQuery('id', null);
     if ($eventId) {
         $eventObj = Element_OphTrLaser_Site::model()->find('event_id = ' . $eventId);
         $lasers = OphTrLaser_Site_Laser::model()->activeOrPk($eventObj->laser_id)->findAll();
     } else {
         $lasers = OphTrLaser_Site_Laser::model()->active()->findAll();
     }
     $l_by_s = array();
     foreach ($lasers as $slaser) {
         $l_by_s[$slaser->site_id][] = array('id' => $slaser->id, 'name' => $slaser->name);
     }
     Yii::app()->getClientScript()->registerScript('OphTrLaserJS', 'var lasersBySite = ' . CJavaScript::encode($l_by_s) . ';', CClientScript::POS_HEAD);
 }
All Usage Examples Of OphTrLaser_Site_Laser::model