|
@@ -101,6 +101,14 @@ class ElementSearcher extends Searcher implements SearcherInterface
|
101
|
101
|
protected $tag_strict = false;
|
102
|
102
|
|
103
|
103
|
/**
|
|
104
|
+ * A renseigné pour une recherche portant sur les nom
|
|
105
|
+ *
|
|
106
|
+ * @var string
|
|
107
|
+ */
|
|
108
|
+ protected $string = null;
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+ /**
|
104
|
112
|
* @see SearcherInterface
|
105
|
113
|
* @param array $params
|
106
|
114
|
*/
|
|
@@ -115,7 +123,7 @@ class ElementSearcher extends Searcher implements SearcherInterface
|
115
|
123
|
$this->setAttributes(array(
|
116
|
124
|
'network', 'tags', 'count', 'user_id', 'group_id',
|
117
|
125
|
'favorite', 'id_limit', 'searchnew', 'ids', 'ids_display',
|
118
|
|
- 'tag_strict'
|
|
126
|
+ 'tag_strict', 'string'
|
119
|
127
|
), $params);
|
120
|
128
|
|
121
|
129
|
}
|
|
@@ -130,7 +138,7 @@ class ElementSearcher extends Searcher implements SearcherInterface
|
130
|
138
|
$this->setAttributes(array(
|
131
|
139
|
'network', 'tags', 'count', 'user_id', 'group_id',
|
132
|
140
|
'favorite', 'id_limit', 'searchnew', 'ids', 'ids_display',
|
133
|
|
- 'tag_strict'
|
|
141
|
+ 'tag_strict', 'string'
|
134
|
142
|
), $params);
|
135
|
143
|
}
|
136
|
144
|
|
|
@@ -150,7 +158,8 @@ class ElementSearcher extends Searcher implements SearcherInterface
|
150
|
158
|
'favorite' => $this->isFavorite(),
|
151
|
159
|
'ids' => $this->getIds(),
|
152
|
160
|
'ids_display' => $this->getIdsDisplay(),
|
153
|
|
- 'tag_strict' => $this->getTagStrict()
|
|
161
|
+ 'tag_strict' => $this->getTagStrict(),
|
|
162
|
+ 'string' => $this->getString()
|
154
|
163
|
);
|
155
|
164
|
}
|
156
|
165
|
|
|
@@ -255,6 +264,16 @@ class ElementSearcher extends Searcher implements SearcherInterface
|
255
|
264
|
{
|
256
|
265
|
return $this->tag_strict;
|
257
|
266
|
}
|
|
267
|
+
|
|
268
|
+ public function setString($string)
|
|
269
|
+ {
|
|
270
|
+ $this->string = $string;
|
|
271
|
+ }
|
|
272
|
+
|
|
273
|
+ public function getString()
|
|
274
|
+ {
|
|
275
|
+ return $this->string;
|
|
276
|
+ }
|
258
|
277
|
|
259
|
278
|
/**
|
260
|
279
|
* Construction de l'objet Query
|
|
@@ -265,11 +284,11 @@ class ElementSearcher extends Searcher implements SearcherInterface
|
265
|
284
|
*
|
266
|
285
|
* @return collection
|
267
|
286
|
*/
|
268
|
|
- protected function constructQueryObject(Registry $doctrine, $user_id, $exec_type = 'execute')
|
|
287
|
+ protected function constructQueryObject(Registry $doctrine, $user_id, $exec_type = 'execute', $params = array())
|
269
|
288
|
{
|
270
|
289
|
$this->setQuery($doctrine
|
271
|
290
|
->getRepository('MuzichCoreBundle:Element')
|
272
|
|
- ->findBySearch($this, $user_id, $exec_type))
|
|
291
|
+ ->findBySearch($this, $user_id, $exec_type, $params))
|
273
|
292
|
;
|
274
|
293
|
}
|
275
|
294
|
|
|
@@ -282,9 +301,9 @@ class ElementSearcher extends Searcher implements SearcherInterface
|
282
|
301
|
*
|
283
|
302
|
* @return collection
|
284
|
303
|
*/
|
285
|
|
- public function getQuery(Registry $doctrine, $user_id, $exec_type = 'execute')
|
|
304
|
+ public function getQuery(Registry $doctrine, $user_id, $exec_type = 'execute', $params = array())
|
286
|
305
|
{
|
287
|
|
- $this->constructQueryObject($doctrine, $user_id, $exec_type);
|
|
306
|
+ $this->constructQueryObject($doctrine, $user_id, $exec_type, $params);
|
288
|
307
|
return $this->query;
|
289
|
308
|
}
|
290
|
309
|
|
|
@@ -298,9 +317,9 @@ class ElementSearcher extends Searcher implements SearcherInterface
|
298
|
317
|
*
|
299
|
318
|
* @return collection
|
300
|
319
|
*/
|
301
|
|
- public function getElements(Registry $doctrine, $user_id, $exec_type = 'execute')
|
|
320
|
+ public function getElements(Registry $doctrine, $user_id, $exec_type = 'execute', $params = array())
|
302
|
321
|
{
|
303
|
|
- $query = $this->getQuery($doctrine, $user_id, $exec_type);
|
|
322
|
+ $query = $this->getQuery($doctrine, $user_id, $exec_type, $params);
|
304
|
323
|
|
305
|
324
|
switch ($exec_type)
|
306
|
325
|
{
|