Passed
Push — master ( c0a3a7...3b84a4 )
by Jeroen
58:51
created

engine/classes/Elgg/Database/QueryExecuting.php (1 issue)

1
<?php
2
3
namespace Elgg\Database;
4
5
use Closure;
6
use ElggBatch;
7
8
/**
9
 * This interface defines methods for building fluent interactions with a database repository
10
 */
11
interface QueryExecuting {
12
13
	/**
14
	 * Count rows
15
	 * @return int
16
	 */
17
	public function count();
18
19
	/**
20
	 * Apply numeric calculation to a column
21
	 *
22
	 * @param string $function      Calculation, e.g. max, min, avg
23
	 * @param string $property      Property name
24
	 * @param string $property_type Property type
25
	 *
26
	 * @return int|float
27
	 */
28
	public function calculate($function, $property, $property_type = null);
29
30
	/**
31
	 * Fetch rows
32
	 *
33
	 * @param int            $limit    Number of rows to fetch
34
	 * @param int            $offset   Index of the first row
35
	 * @param callable|false $callback Callback function to run database rows through
36
	 *
37
	 * @return \ElggData[]|false
38
	 */
39
	public function get($limit = null, $offset = null, $callback = null);
40
41
	/**
42
	 * Fetch rows as an ElggBatch
43
	 *
44
	 * @param int            $limit    Number of rows to fetch
45
	 * @param int            $offset   Index of the first row
46
	 * @param callable|false $callback Callback function to run database rows through
47
	 *
48
	 * @return ElggBatch
49
	 */
50
	public function batch($limit = null, $offset = null, $callback = null);
51
52
	/**
53
	 * Apply correct execution method based on calculation, count or other criteria
54
	 * @return mixed
55
	 */
56
	public function execute();
57
58
	/**
59
	 * Filter query prior to execution
60
	 * Callback function will receive QueryBuilder as the first argument and table alias as a second
61
	 * Callback function can either mutate the instance of the QueryBuilder or return a composition expression
62
	 * that will be appended to AND where statements
63
	 *
64
	 * @param Closure $closure Filter
65
	 *
66
	 * @return static
67
	 */
68
	public function filter(Closure $closure);
69
70
	/**
71
	 * Add SELECT
72
	 *
73
	 * @param mixed $expression Select
74
	 *
75
	 * @return static
76
	 */
77
	public function select($expression);
78
79
	/**
80
	 * Add JOIN clause
81
	 * Join a database table on an $x to $y comparison
82
	 *
83
	 * @param string $joined_table   Name of the table (with or without dbprefix)
84
	 * @param string $joined_alias   Alias of the joined table
85
	 *                               If not set, the alias will be assigned automatically
86
	 * @param string $x              Base column, e.g. 'n_table.entity_guid'
87
	 *                               This value is NOT a query parameter and will not be sanitized
88
	 * @param string $comparison     Comparison operator, e.g. '=', 'not like' etc
89
	 * @param mixed  $y              Comparison value(s)
90
	 * @param string $type           Type of the comparison value(s), e.g. ELGG_VALUE_STRING, ELGG_VALUE_INT
91
	 * @param bool   $case_sensitive Use case senstivie comparison for string values
92
	 *
93
	 * @return static
94
	 */
95
	public function join($joined_table, $joined_alias = null, $x = null, $comparison = null, $y = null, $type = null, $case_sensitive = null);
96
97
	/**
98
	 * Add GROUP BY
99
	 *
100
	 * @param string $expression Group by
101
	 *
102
	 * @return static
103
	 */
104
	public function groupBy($expression);
105
106
	/**
107
	 * Add HAVING
108
	 *
109
	 * @param sring $expression Having
0 ignored issues
show
The type Elgg\Database\sring was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
110
	 *
111
	 * @return static
112
	 */
113
	public function having($expression);
114
115
	/**
116
	 * Add ORDER BY
117
	 *
118
	 * @param string $expression Column/calculation
119
	 * @param string $direction  Direction
120
	 *
121
	 * @return static
122
	 */
123
	public function orderBy($expression, $direction);
124
125
}
126