@@ 71-82 (lines=12) @@ | ||
68 | * |
|
69 | * @return int |
|
70 | */ |
|
71 | public function count() |
|
72 | { |
|
73 | $className = $this->bxObject->getClassName(); |
|
74 | $queryType = 'D7Query::count'; |
|
75 | $filter = $this->filter; |
|
76 | ||
77 | $callback = function () use ($filter) { |
|
78 | return (int) $this->bxObject->getCount($filter); |
|
79 | }; |
|
80 | ||
81 | return $this->handleCacheIfNeeded(compact('className', 'filter', 'queryType'), $callback); |
|
82 | } |
|
83 | ||
84 | /** |
|
85 | * Get list of items. |
@@ 220-234 (lines=15) @@ | ||
217 | * |
|
218 | * @return int |
|
219 | */ |
|
220 | public function count() |
|
221 | { |
|
222 | if ($this->queryShouldBeStopped) { |
|
223 | return 0; |
|
224 | } |
|
225 | ||
226 | $filter = $this->normalizeFilter(); |
|
227 | $queryType = "ElementQuery::count"; |
|
228 | ||
229 | $callback = function () use ($filter) { |
|
230 | return (int) $this->bxObject->GetList(false, $filter, []); |
|
231 | }; |
|
232 | ||
233 | return $this->handleCacheIfNeeded(compact('filter', 'queryType'), $callback); |
|
234 | } |
|
235 | ||
236 | // /** |
|
237 | // * Normalize properties's format converting it to 'PROPERTY_"CODE"_VALUE'. |