/** * @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); }
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); }
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); }