PatientMergeRequest::model PHP Метод

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

Please note that you should have this exact method in all your CActiveRecord descendants!
public static model ( string $className = __CLASS__ ) : PatientMergeRequest
$className string active record class name.
Результат PatientMergeRequest the static model class
    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }

Usage Example

 /**
  * Check if the paient id is already in the request list.
  * 
  * @param int $patientId
  *
  * @return null|string 'primary' or 'secondary', this means, e.g.:  patient id was submited for merge as secondary patient
  */
 public function isPatientInRequestList($patientId)
 {
     $criteria = new CDbCriteria();
     $criteria->condition = 'secondary_id=:patient_id OR ( primary_id=:patient_id AND status = ' . PatientMergeRequest::STATUS_NOT_PROCESSED . ') AND deleted = 0';
     $criteria->params = array(':patient_id' => $patientId);
     $mergeRequest = PatientMergeRequest::model()->find($criteria);
     return $mergeRequest ? $mergeRequest->primary_id == $patientId ? 'primary' : 'secondary' : null;
 }
All Usage Examples Of PatientMergeRequest::model