SecondaryToCommonOphthalmicDisorder::model PHP Method

model() public static method

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

Usage Example

 /**
  * Wrapper to handle ordering for secondary to disorders
  *
  * @param $cod
  * @return mixed
  */
 public function getNextDisplayOrderForParent($cod)
 {
     if (!array_key_exists($cod->id, $this->second_display_order)) {
         $criteria = new CDbCriteria();
         $criteria->addCondition('parent_id = :id');
         $criteria->params[':id'] = $cod->id;
         $criteria->order = 'display_order desc';
         $criteria->limit = 1;
         if ($st = SecondaryToCommonOphthalmicDisorder::model()->find($criteria)) {
             $this->second_display_order[$cod->id] = $st->display_order;
         } else {
             $this->second_display_order[$cod->id] = 0;
         }
     }
     return ++$this->second_display_order[$cod->id];
 }
All Usage Examples Of SecondaryToCommonOphthalmicDisorder::model