Completed
Push — master ( 98f87b...ef48e3 )
by Michael
05:41 queued 02:12
created

src/QueryInterface.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/**
4
 * This file is part of the miBadger package.
5
 *
6
 * @author Michael Webbers <[email protected]>
7
 * @license http://opensource.org/licenses/Apache-2.0 Apache v2 License
8
 * @version 1.0.0
9
 */
10
11
namespace miBadger\Query;
12
13
/**
14
 * The query interface.
15
 *
16
 * @see https://en.wikipedia.org/wiki/SQL
17
 * @since 1.0.0
18
 */
19
interface QueryInterface
20
{
21
	const SELECT = 'SELECT';
22
	const INSERT = 'INSERT INTO';
23
	const UPDATE = 'UPDATE';
24
	const DELETE = 'DELETE';
25
26
	/**
27
	 * Set the modifier to select and select the given columns.
28
	 *
29
	 * @param array|string $columns = ['*']
30
	 * @return $this
31
	 * @see https://en.wikipedia.org/wiki/SQL#Queries
32
	 */
33
	public function select($columns = ['*']);
34
35
	/**
36
	 * Set the modifier to insert and insert the given values.
37
	 *
38
	 * @param array $values
39
	 * @return $this
40
	 * @see https://en.wikipedia.org/wiki/SQL#Data_manipulation
41
	 */
42
	public function insert(array $values);
43
44
	/**
45
	 * Set the modifier to update and update the given columns.
46
	 *
47
	 * @param array $values
48
	 * @return $this
49
	 * @see https://en.wikipedia.org/wiki/SQL#Data_manipulation
50
	 */
51
	public function update(array $values);
52
53
	/**
54
	 * Set the data modifier to delete.
55
	 *
56
	 * @return $this
57
	 * @see https://en.wikipedia.org/wiki/SQL#Data_manipulation
58
	 */
59
	public function delete();
60
61
	/**
62
	 * Set an additional where condition.
63
	 *
64
	 * @param string $column
65
	 * @param string $operator
66
	 * @param mixed $value
67
	 * @return $this
68
	 * @see https://en.wikipedia.org/wiki/SQL#Operators
69
	 */
70
	public function where($column, $operator, $value);
71
72
	/**
73
	 * Set an additional group by.
74
	 *
75
	 * @param string $column
76
	 */
77
	public function groupBy($column);
0 ignored issues
show
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
78
79
	/**
80
	 * Set an additional order condition.
81
	 *
82
	 * @param string $column
83
	 * @param string|null $order
84
	 * @return $this
85
	 */
86
	public function orderBy($column, $order = null);
87
88
	/**
89
	 * Set the limit.
90
	 *
91
	 * @param mixed $limit
92
	 * @return $this
93
	 */
94
	public function limit($limit);
95
96
	/**
97
	 * Set the offset.
98
	 *
99
	 * @param mixed $offset
100
 	 * @return $this
101
	 */
102
	public function offset($offset);
103
}
104