Passed
Push — master ( 157485...b7615a )
by Nikolaos
09:23
created

QueryFactory   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 58
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A newSelect() 0 3 1
A newInsert() 0 3 1
A newUpdate() 0 3 1
A newDelete() 0 3 1
A newBind() 0 3 1
1
<?php
2
3
/**
4
 * This file is part of the Phalcon Framework.
5
 *
6
 * (c) Phalcon Team <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE.txt
9
 * file that was distributed with this source code.
10
 *
11
 * Implementation of this file has been influenced by AtlasPHP
12
 *
13
 * @link    https://github.com/atlasphp/Atlas.Query
14
 * @license https://github.com/atlasphp/Atlas.Qyert/blob/1.x/LICENSE.md
15
 */
16
17
declare(strict_types=1);
18
19
namespace Phalcon\DataMapper\Query;
20
21
use Phalcon\DataMapper\Pdo\Connection;
22
23
/**
24
 * Class QueryFactory
25
 *
26
 * @property string $class
27
 */
28
class QueryFactory
29
{
30
    /**
31
     * Create a new Bind object
32
     *
33
     * @return Bind
34
     */
35
    public function newBind(): Bind
36
    {
37
        return new Bind();
38
    }
39
40
    /**
41
     * Create a new Delete object
42
     *
43
     * @param Connection $connection
44
     *
45
     * @return Delete
46
     */
47
    public function newDelete(Connection $connection): Delete
48
    {
49
        return new Delete($connection, $this->newBind());
50
    }
51
52
    /**
53
     * Create a new Insert object
54
     *
55
     * @param Connection $connection
56
     *
57
     * @return Insert
58
     */
59
    public function newInsert(Connection $connection): Insert
60
    {
61
        return new Insert($connection, $this->newBind());
62
    }
63
64
    /**
65
     * Create a new Select object
66
     *
67
     * @param Connection $connection
68
     *
69
     * @return Select
70
     */
71
    public function newSelect(Connection $connection): Select
72
    {
73
        return new Select($connection, $this->newBind());
74
    }
75
76
    /**
77
     * Create a new Update object
78
     *
79
     * @param Connection $connection
80
     *
81
     * @return Update
82
     */
83
    public function newUpdate(Connection $connection): Update
84
    {
85
        return new Update($connection, $this->newBind());
86
    }
87
}
88