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