1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* This file is part of Phuria SQL Builder package. |
5
|
|
|
* |
6
|
|
|
* Copyright (c) 2016 Beniamin Jonatan Šimko |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Phuria\SQLBuilder; |
13
|
|
|
|
14
|
|
|
use Interop\Container\ContainerInterface; |
15
|
|
|
use Phuria\SQLBuilder\DependencyInjection\InternalContainer; |
16
|
|
|
use Phuria\SQLBuilder\QueryBuilder\DeleteBuilder; |
17
|
|
|
use Phuria\SQLBuilder\QueryBuilder\InsertBuilder; |
18
|
|
|
use Phuria\SQLBuilder\QueryBuilder\InsertSelectBuilder; |
19
|
|
|
use Phuria\SQLBuilder\QueryBuilder\SelectBuilder; |
20
|
|
|
use Phuria\SQLBuilder\QueryBuilder\UpdateBuilder; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @author Beniamin Jonatan Šimko <[email protected]> |
24
|
|
|
*/ |
25
|
|
|
class QB |
|
|
|
|
26
|
|
|
{ |
27
|
|
|
/** |
28
|
|
|
* @var ContainerInterface $container |
29
|
|
|
*/ |
30
|
|
|
private static $container; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @return ContainerInterface |
34
|
|
|
*/ |
35
|
|
|
public static function getContainer() |
36
|
|
|
{ |
37
|
|
|
if (null === static::$container) { |
|
|
|
|
38
|
|
|
static::$container = new InternalContainer(); |
|
|
|
|
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
return static::$container; |
|
|
|
|
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @return SelectBuilder |
46
|
|
|
*/ |
47
|
|
|
public static function select() |
48
|
|
|
{ |
49
|
|
|
return new SelectBuilder(static::getContainer()); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @return UpdateBuilder |
54
|
|
|
*/ |
55
|
|
|
public static function update() |
56
|
|
|
{ |
57
|
|
|
return new UpdateBuilder(static::getContainer()); |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @return DeleteBuilder |
62
|
|
|
*/ |
63
|
|
|
public static function delete() |
64
|
|
|
{ |
65
|
|
|
return new DeleteBuilder(static::getContainer()); |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @return InsertBuilder |
70
|
|
|
*/ |
71
|
|
|
public static function insert() |
72
|
|
|
{ |
73
|
|
|
return new InsertBuilder(static::getContainer()); |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @return InsertSelectBuilder |
78
|
|
|
*/ |
79
|
|
|
public static function insertSelect() |
80
|
|
|
{ |
81
|
|
|
return new InsertSelectBuilder(static::getContainer()); |
82
|
|
|
} |
83
|
|
|
} |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.