@@ -22,19 +22,38 @@ interface SearchService
22
22
/**
23
23
* Finds content objects for the given query.
24
24
*
25
- * @todo define structs for the field filters
26
- *
27
25
* @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException if query is not valid
28
26
*
29
27
* @param \eZ\Publish\API\Repository\Values\Content\Query $query
30
- * @param array $fieldFilters - a map of filters for the returned fields.
28
+ * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on.
29
+ * Also used to define which field languages are loaded for the returned content.
31
30
* Currently supports: <code>array("languages" => array(<language1>,..), "useAlwaysAvailable" => bool)</code>
32
31
* useAlwaysAvailable defaults to true to avoid exceptions on missing translations
33
32
* @param bool $filterOnUserPermissions if true only the objects which is the user allowed to read are returned.
34
33
*
35
34
* @return \eZ\Publish\API\Repository\Values\Content\Search\SearchResult
36
35
*/
37
- public function findContent (Query $ query , array $ fieldFilters = array (), $ filterOnUserPermissions = true );
36
+ public function findContent (Query $ query , array $ languageFilter = array (), $ filterOnUserPermissions = true );
37
+
38
+ /**
39
+ * Finds contentInfo objects for the given query.
40
+ *
41
+ * This method works just like findContent, however does not load the full Content Objects. This means
42
+ * it can be more efficient for use cases where you don't need the full Content. Also including use cases
43
+ * where content will be loaded by separate code, like an ESI based sub requests that takes content ID as input.
44
+ *
45
+ * @since 5.4.5
46
+ * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException if query is not valid
47
+ *
48
+ * @param \eZ\Publish\API\Repository\Values\Content\Query $query
49
+ * @param array $languageFilter - a map of filters for the returned fields.
50
+ * Currently supports: <code>array("languages" => array(<language1>,..), "useAlwaysAvailable" => bool)</code>
51
+ * useAlwaysAvailable defaults to true to avoid exceptions on missing translations
52
+ * @param bool $filterOnUserPermissions if true (default) only the objects which is the user allowed to read are returned.
53
+ *
54
+ * @return \eZ\Publish\API\Repository\Values\Content\Search\SearchResult
55
+ */
56
+ public function findContentInfo (Query $ query , array $ languageFilter = array (), $ filterOnUserPermissions = true );
38
57
39
58
/**
40
59
* Performs a query for a single content object.
@@ -43,17 +62,15 @@ public function findContent(Query $query, array $fieldFilters = array(), $filter
43
62
* @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException if criterion is not valid
44
63
* @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException if there is more than than one result matching the criterions
45
64
*
46
- * @todo define structs for the field filters
47
- *
48
65
* @param \eZ\Publish\API\Repository\Values\Content\Query\Criterion $filter
49
- * @param array $fieldFilters - a map of filters for the returned fields .
66
+ * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on .
50
67
* Currently supports: <code>array("languages" => array(<language1>,..), "useAlwaysAvailable" => bool)</code>
51
68
* useAlwaysAvailable defaults to true to avoid exceptions on missing translations
52
69
* @param bool $filterOnUserPermissions if true only the objects which is the user allowed to read are returned.
53
70
*
54
71
* @return \eZ\Publish\API\Repository\Values\Content\Content
55
72
*/
56
- public function findSingle (Criterion $ filter , array $ fieldFilters = array (), $ filterOnUserPermissions = true );
73
+ public function findSingle (Criterion $ filter , array $ languageFilter = array (), $ filterOnUserPermissions = true );
57
74
58
75
/**
59
76
* Suggests a list of values for the given prefix.
@@ -71,12 +88,12 @@ public function suggest($prefix, $fieldPaths = array(), $limit = 10, Criterion $
71
88
* @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException if query is not valid
72
89
*
73
90
* @param \eZ\Publish\API\Repository\Values\Content\LocationQuery $query
74
- * @param array $fieldFilters - a map of filters for the returned fields .
91
+ * @param array $languageFilter Configuration for specifying prioritized languages query will be performed on .
75
92
* Currently supports: <code>array("languages" => array(<language1>,..), "useAlwaysAvailable" => bool)</code>
76
93
* useAlwaysAvailable defaults to true to avoid exceptions on missing translations
77
94
* @param bool $filterOnUserPermissions if true only the objects which is the user allowed to read are returned.
78
95
*
79
96
* @return \eZ\Publish\API\Repository\Values\Content\Search\SearchResult
80
97
*/
81
- public function findLocations (LocationQuery $ query , array $ fieldFilters = array (), $ filterOnUserPermissions = true );
98
+ public function findLocations (LocationQuery $ query , array $ languageFilter = array (), $ filterOnUserPermissions = true );
82
99
}
0 commit comments