@@ -6,23 +6,23 @@ discard block |
||
| 6 | 6 | |
| 7 | 7 | trait Traceable |
| 8 | 8 | { |
| 9 | - abstract public function get_tracer() : TracerInterface; |
|
| 10 | - abstract public function get_id(); |
|
| 11 | - abstract public static function table_name(); |
|
| 9 | + abstract public function get_tracer() : TracerInterface; |
|
| 10 | + abstract public function get_id(); |
|
| 11 | + abstract public static function table_name(); |
|
| 12 | 12 | |
| 13 | 13 | |
| 14 | - public function trace() |
|
| 15 | - { |
|
| 14 | + public function trace() |
|
| 15 | + { |
|
| 16 | 16 | ; |
| 17 | - } |
|
| 17 | + } |
|
| 18 | 18 | |
| 19 | - public function traceable(): bool |
|
| 20 | - { |
|
| 19 | + public function traceable(): bool |
|
| 20 | + { |
|
| 21 | 21 | return true; // TightORM are traced by default |
| 22 | - } |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - public function traces() : array |
|
| 25 | - { |
|
| 24 | + public function traces() : array |
|
| 25 | + { |
|
| 26 | 26 | $q = $this->get_tracer()->tracing_table()->select(); |
| 27 | 27 | $q->aw_fields_eq(['query_table' => get_class($this)::table_name(), 'query_id' => $this->get_id()]); |
| 28 | 28 | $q->order_by(['query_on', 'DESC']); |
@@ -30,21 +30,21 @@ discard block |
||
| 30 | 30 | $res = $q->ret_ass(); |
| 31 | 31 | |
| 32 | 32 | return $res; |
| 33 | - } |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - // don't really know the purpose of this anymore.. came from Tracer |
|
| 36 | - public function traces_by_model(ModelInterface $m) |
|
| 37 | - { |
|
| 38 | - return $this->get_tracer()->traces(['id' => $m->get_id(), 'table' => get_class($m)::table_name()]); |
|
| 39 | - } |
|
| 35 | + // don't really know the purpose of this anymore.. came from Tracer |
|
| 36 | + public function traces_by_model(ModelInterface $m) |
|
| 37 | + { |
|
| 38 | + return $this->get_tracer()->traces(['id' => $m->get_id(), 'table' => get_class($m)::table_name()]); |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - public function after_save() |
|
| 42 | - { |
|
| 41 | + public function after_save() |
|
| 42 | + { |
|
| 43 | 43 | ; |
| 44 | - } |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - public function after_destroy() |
|
| 47 | - { |
|
| 46 | + public function after_destroy() |
|
| 47 | + { |
|
| 48 | 48 | ; |
| 49 | - } |
|
| 49 | + } |
|
| 50 | 50 | } |