Completed
Push — master ( a24de7...5bce41 )
by Kévin
03:41
created

EloquentVisitor::getCompilationData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace RulerZ\Target\Eloquent;
4
5
use Hoa\Ruler\Model as AST;
6
7
use RulerZ\Compiler\Context;
8
use RulerZ\Target\GenericSqlVisitor;
9
use RulerZ\Target\Operators\Definitions as OperatorsDefinitions;
10
11
class EloquentVisitor extends GenericSqlVisitor
12
{
13
    /**
14
     * Allow eloquent builder as query.
15
     *
16
     * @var bool
17
     */
18
    protected $allowEloquentBuilderAsQuery = false;
19
20
    public function __construct(
21
        Context $context,
22
        OperatorsDefinitions $operators,
23
        $allowStarOperator = true,
24
        $allowEloquentBuilderAsQuery = false
25
    ) {
26
        parent::__construct($context, $operators, $allowStarOperator);
27
28
        $this->allowEloquentBuilderAsQuery = (bool) $allowEloquentBuilderAsQuery;
29
    }
30
31
    /**
32
     * @inheritDoc
33
     */
34
    public function getCompilationData()
35
    {
36
        return [
37
            'allowEloquentBuilderAsQuery ' => $this->allowEloquentBuilderAsQuery,
38
        ];
39
    }
40
}
41