Completed
Push — master ( 5bff48...0eeb04 )
by Oscar
02:44
created

BaseQuery::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace SimpleCrud\Queries;
4
5
use SimpleCrud\Entity;
6
use SimpleCrud\QueryInterface;
7
8
/**
9
 * Base class used by all queries.
10
 */
11
abstract class BaseQuery implements QueryInterface
12
{
13
    protected $entity;
14
15
    /**
16
     * Constructor.
17
     *
18
     * @param Entity $entity
19
     */
20
    public function __construct(Entity $entity)
21
    {
22
        $this->entity = $entity;
23
    }
24
25
    /**
26
     * Executes the query and returns true if it's ok
27
     * 
28
     * @return bool
29
     */
30
    public function run()
31
    {
32
        $this->__invoke();
33
34
        return true;
35
    }
36
}
37