1 | <?php namespace Arcanedev\LaravelTracker\Models; |
||
15 | abstract class AbstractModel extends Model |
||
16 | { |
||
17 | /* ------------------------------------------------------------------------------------------------ |
||
18 | | Constructor |
||
19 | | ------------------------------------------------------------------------------------------------ |
||
20 | */ |
||
21 | /** |
||
22 | * Create a new Eloquent model instance. |
||
23 | * |
||
24 | * @param array $attributes |
||
25 | */ |
||
26 | 42 | public function __construct(array $attributes = []) |
|
33 | |||
34 | /* ------------------------------------------------------------------------------------------------ |
||
35 | | Other Functions |
||
36 | | ------------------------------------------------------------------------------------------------ |
||
37 | */ |
||
38 | /** |
||
39 | * Get the tracker config. |
||
40 | * |
||
41 | * @param string $key |
||
42 | * @param mixed|null $default |
||
43 | * |
||
44 | * @return mixed |
||
45 | */ |
||
46 | 42 | protected function getConfig($key, $default = null) |
|
50 | |||
51 | /** |
||
52 | * Get the model class. |
||
53 | * |
||
54 | * @param string $name |
||
55 | * @param string|null $default |
||
56 | * |
||
57 | * @return string |
||
58 | */ |
||
59 | 6 | protected function getModelClass($name, $default = null) |
|
63 | |||
64 | /* ------------------------------------------------------------------------------------------------ |
||
65 | | Laravel 5.2 & 5.1 Support |
||
66 | | ------------------------------------------------------------------------------------------------ |
||
67 | */ |
||
68 | /** |
||
69 | * Handle dynamic method calls into the model. |
||
70 | * |
||
71 | * @param string $method |
||
72 | * @param array $parameters |
||
73 | * |
||
74 | * @return mixed |
||
75 | */ |
||
76 | 39 | public function __call($method, $parameters) |
|
83 | |||
84 | /** |
||
85 | * Get the first record matching the attributes or create it. |
||
86 | * |
||
87 | * @param array $attributes |
||
88 | * @param array $values |
||
89 | * |
||
90 | * @return self |
||
91 | */ |
||
92 | public function customFirstOrCreate(array $attributes, array $values = []) |
||
107 | } |
||
108 |