model() публичный статический Метод

Returns the static model of the specified AR class.
public static model ( $className = __CLASS__ ) : the
Результат the static model class
Пример #1
0
 /**
  * Abstraction of the list provider
  *
  * @param array $filter
  * @return \CActiveDataProvider
  */
 public function getListDataProvider($filter = array())
 {
     $model = Element_OphCoCvi_EventInfo::model()->with('site', 'user', 'clinical_element', 'clinical_element.consultant', 'clerical_element', 'event.episode.patient.contact', 'event.episode.firm.serviceSubspecialtyAssignment.subspecialty');
     $sort = new \CSort();
     $sort->attributes = array('event_date' => array('asc' => 'event.event_date asc, event.id asc', 'desc' => 'event.event_date desc, event.id desc'), 'subspecialty' => array('asc' => 'lower(subspecialty.name) asc, event.id asc', 'desc' => 'lower(subspecialty.name) desc, event.id desc'), 'site' => array('asc' => 'lower(site.name) asc, event.id asc', 'desc' => 'lower(site.name) desc, event.id desc'), 'patient_name' => array('asc' => 'lower(contact.last_name) asc, lower(contact.first_name) asc', 'desc' => 'lower(contact.last_name) desc, lower(contact.first_name) desc'), 'hosnum' => array('asc' => 'patient.hos_num asc, patient.id asc, event.id asc', 'desc' => 'patient.hos_num desc, patient.id desc, event.id desc'), 'creator' => array('asc' => 'lower(user.last_name) asc, lower(user.first_name) asc, event.id asc', 'desc' => 'lower(user.last_name) desc, lower(user.first_name) desc, event.id desc'), 'consultant' => array('asc' => 'lower(consultant.last_name) asc, lower(consultant.first_name) asc, event.id asc', 'desc' => 'lower(consultant.last_name) desc, lower(consultant.first_name) desc, event.id desc'), 'issue_status' => array('asc' => 'is_draft desc, event.id asc', 'desc' => 'is_draft asc, event.id desc'), 'issue_date' => array('asc' => 'is_draft asc, t.last_modified_date asc', 'desc' => 'is_draft asc, t.last_modified_date desc'));
     $criteria = $this->buildFilterCriteria($filter);
     return new \CActiveDataProvider($model, array('sort' => $sort, 'criteria' => $criteria));
 }