1 | <?php |
||
7 | class BlameableService |
||
8 | { |
||
9 | /** |
||
10 | * Global configurations from config/blameable.php. |
||
11 | * |
||
12 | * @var array |
||
13 | */ |
||
14 | private $globalConfig; |
||
15 | |||
16 | /** |
||
17 | * Blameable Service Constructor. |
||
18 | */ |
||
19 | public function __construct() |
||
23 | |||
24 | /** |
||
25 | * Get configurations for the given Model. |
||
26 | * |
||
27 | * @param \Illuminate\Database\Eloquent\Model $model |
||
28 | * |
||
29 | * @return array |
||
30 | */ |
||
31 | private function getConfigurations(Model $model) |
||
38 | |||
39 | /** |
||
40 | * Get current configuration value for the given attributes. |
||
41 | * |
||
42 | * @param \Illuminate\Database\Eloquent\Model $model |
||
43 | * @param string $key |
||
44 | * |
||
45 | * @return string |
||
46 | */ |
||
47 | public function getConfiguration(Model $model, $key) |
||
51 | |||
52 | /** |
||
53 | * Load default blameable configurations. |
||
54 | * |
||
55 | * @return void |
||
56 | */ |
||
57 | public function loadConfig() |
||
61 | |||
62 | /** |
||
63 | * Set Model's attribute value for the given key. |
||
64 | * |
||
65 | * @param Model $model |
||
66 | * @param string $key |
||
67 | * @param bool $reset |
||
68 | * |
||
69 | * @return bool |
||
70 | */ |
||
71 | public function setAttribute(Model $model, $key, $reset = false) |
||
82 | } |
||
83 |