public static model ( $className = __CLASS__ ) : PreviousOperation | ||
return | PreviousOperation | the static model class |
public static function model($className = __CLASS__)
{
return parent::model($className);
}
public function actionGetPreviousOperation() { if (!($po = PreviousOperation::model()->findByPk(@$_GET['operation_id']))) { throw new Exception("Previous operation not found: " . @$_GET['operation_id']); } $date = explode('-', $po->date); echo json_encode(array('operation' => $po->operation, 'side_id' => $po->side_id, 'fuzzy_year' => $date[0], 'fuzzy_month' => preg_replace('/^0/', '', $date[1]), 'fuzzy_day' => preg_replace('/^0/', '', $date[2]))); }