Ejemplo n.º 1
0
 /**
  * @param AddToTimelineCommand $command
  * @return bool
  */
 public function handle($command)
 {
     $model = new TimelineEvent();
     $model->application = \Yii::$app->id;
     $model->category = $command->category;
     $model->event = $command->event;
     $model->data = json_encode($command->data, JSON_UNESCAPED_UNICODE);
     return $model->save(false);
 }
Ejemplo n.º 2
0
 public static function log($category, $event, $data = null)
 {
     $model = new TimelineEvent();
     $model->application = Yii::$app->id;
     $model->category = $category;
     $model->event = $event;
     $model->data = json_encode($data, JSON_UNESCAPED_UNICODE);
     return $model->save(false);
 }
Ejemplo n.º 3
0
 public static function log($category, $event, $data = null)
 {
     $model = new TimelineEvent();
     $model->application = Yii::$app->id;
     $model->category = $category;
     $model->event = $event;
     $model->data = json_encode($data, JSON_UNESCAPED_UNICODE);
     if (!empty($data['attributes']['id'])) {
         $model->row_id = $data['attributes']['id'];
     }
     return $model->save(false);
 }