1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Trucker\Factories; |
4
|
|
|
|
5
|
|
|
use Trucker\Facades\Config; |
6
|
|
|
use Trucker\Framework\FactoryDriver; |
7
|
|
|
|
8
|
|
|
class QueryConditionFactory extends FactoryDriver |
9
|
|
|
{ |
10
|
|
|
/** |
11
|
|
|
* Function to return a string representaion of the namespace |
12
|
|
|
* that all classes built by the factory should be contained within. |
13
|
|
|
* |
14
|
|
|
* @return string - namespace string |
15
|
|
|
*/ |
16
|
4 |
|
public function getDriverNamespace() |
17
|
|
|
{ |
18
|
4 |
|
return "\Trucker\Finders\Conditions"; |
19
|
|
|
} |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Function to return the interface that the driver's produced |
23
|
|
|
* by the factory must implement. |
24
|
|
|
* |
25
|
|
|
* @return string |
26
|
|
|
*/ |
27
|
3 |
|
public function getDriverInterface() |
28
|
|
|
{ |
29
|
3 |
|
return "\Trucker\Finders\Conditions\QueryConditionInterface"; |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* Function to return a string that should be suffixed |
34
|
|
|
* to the studly-cased driver name of all the drivers |
35
|
|
|
* that the factory can return. |
36
|
|
|
* |
37
|
|
|
* @return string |
38
|
|
|
*/ |
39
|
4 |
|
public function getDriverNameSuffix() |
40
|
|
|
{ |
41
|
4 |
|
return 'QueryCondition'; |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* Function to return a string that should be prefixed |
46
|
|
|
* to the studly-cased driver name of all the drivers |
47
|
|
|
* that the factory can return. |
48
|
|
|
* |
49
|
|
|
* @return string |
50
|
|
|
*/ |
51
|
4 |
|
public function getDriverNamePrefix() |
52
|
|
|
{ |
53
|
4 |
|
return ''; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Function to return an array of arguments that should be |
58
|
|
|
* passed to the constructor of a new driver instance. |
59
|
|
|
* |
60
|
|
|
* @return array |
61
|
|
|
*/ |
62
|
3 |
|
public function getDriverArgumentsArray() |
63
|
|
|
{ |
64
|
3 |
|
return [$this->app]; |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* Function to return the string representation of the driver |
69
|
|
|
* itslef based on a value fetched from the config file. This |
70
|
|
|
* function will itself access the config, and return the driver |
71
|
|
|
* setting. |
72
|
|
|
* |
73
|
|
|
* @return string |
74
|
|
|
*/ |
75
|
4 |
|
public function getDriverConfigValue() |
76
|
|
|
{ |
77
|
4 |
|
return Config::get('query_condition.driver'); |
|
|
|
|
78
|
|
|
} |
79
|
|
|
} |
80
|
|
|
|