1 | <?php |
||
9 | class Grammar extends IlluminateGrammar |
||
10 | { |
||
11 | /** |
||
12 | * ArangoDB handles transactions itself. However most schema actions |
||
13 | * are not done through queries but rather through commands. |
||
14 | * So we just run schema actions sequentially. |
||
15 | * |
||
16 | * @var bool |
||
17 | */ |
||
18 | protected $transactions = false; |
||
19 | |||
20 | /** |
||
21 | * Compile AQL to check if an attribute is in use within a document in the collection. |
||
22 | * If multiple attributes are set then all must be set in one document. |
||
23 | * @param string $collection |
||
24 | * @param Fluent $command |
||
25 | * @return Fluent |
||
26 | */ |
||
27 | public function compileHasAttribute($collection, Fluent $command) |
||
48 | |||
49 | /** |
||
50 | * Compile AQL to rename an attribute, if the new name isn't already in use. |
||
51 | * |
||
52 | * @param string $collection |
||
53 | * @param Fluent $command |
||
54 | * @return Fluent |
||
55 | */ |
||
56 | public function compileRenameAttribute($collection, Fluent $command) |
||
84 | |||
85 | /** |
||
86 | * Compile AQL to drop one or more attributes. |
||
87 | * |
||
88 | * @param string $collection |
||
89 | * @param Fluent $command |
||
90 | * @return Fluent |
||
91 | */ |
||
92 | public function compileDropAttribute($collection, Fluent $command) |
||
114 | |||
115 | /** |
||
116 | * Prepare a bindVar for inclusion in an AQL query. |
||
117 | * |
||
118 | * @param $attribute |
||
119 | * @return string |
||
120 | */ |
||
121 | public function wrapBindVar($attribute) |
||
130 | } |
||
131 |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idable
provides a methodequalsId
that in turn relies on the methodgetId()
. If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()
as an abstract method to the trait will make sure it is available.