| Total Complexity | 95 |
| Total Lines | 726 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
Complex classes like Base often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Base, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 22 | abstract class Base |
||
| 23 | implements \Aimeos\Admin\JQAdm\Iface |
||
| 24 | { |
||
| 25 | private $view; |
||
| 26 | private $aimeos; |
||
| 27 | private $context; |
||
| 28 | private $subclients; |
||
| 29 | |||
| 30 | |||
| 31 | /** |
||
| 32 | * Initializes the class instance. |
||
| 33 | * |
||
| 34 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
||
| 35 | */ |
||
| 36 | public function __construct( \Aimeos\MShop\Context\Item\Iface $context ) |
||
| 39 | } |
||
| 40 | |||
| 41 | |||
| 42 | /** |
||
| 43 | * Catch unknown methods |
||
| 44 | * |
||
| 45 | * @param string $name Name of the method |
||
| 46 | * @param array $param List of method parameter |
||
| 47 | * @throws \Aimeos\Admin\JQAdm\Exception If method call failed |
||
| 48 | */ |
||
| 49 | public function __call( string $name, array $param ) |
||
| 52 | } |
||
| 53 | |||
| 54 | |||
| 55 | /** |
||
| 56 | * Returns the Aimeos bootstrap object |
||
| 57 | * |
||
| 58 | * @return \Aimeos\Bootstrap The Aimeos bootstrap object |
||
| 59 | */ |
||
| 60 | public function getAimeos() : \Aimeos\Bootstrap |
||
| 61 | { |
||
| 62 | if( !isset( $this->aimeos ) ) { |
||
| 63 | throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Aimeos object not available' ) ); |
||
| 64 | } |
||
| 65 | |||
| 66 | return $this->aimeos; |
||
| 67 | } |
||
| 68 | |||
| 69 | |||
| 70 | /** |
||
| 71 | * Sets the Aimeos bootstrap object |
||
| 72 | * |
||
| 73 | * @param \Aimeos\Bootstrap $aimeos The Aimeos bootstrap object |
||
| 74 | * @return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls |
||
| 75 | */ |
||
| 76 | public function setAimeos( \Aimeos\Bootstrap $aimeos ) : \Aimeos\Admin\JQAdm\Iface |
||
| 80 | } |
||
| 81 | |||
| 82 | |||
| 83 | /** |
||
| 84 | * Returns the view object that will generate the admin output. |
||
| 85 | * |
||
| 86 | * @return \Aimeos\MW\View\Iface The view object which generates the admin output |
||
| 87 | */ |
||
| 88 | public function getView() : \Aimeos\MW\View\Iface |
||
| 89 | { |
||
| 90 | if( !isset( $this->view ) ) { |
||
| 91 | throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'No view available' ) ); |
||
| 92 | } |
||
| 93 | |||
| 94 | return $this->view; |
||
| 95 | } |
||
| 96 | |||
| 97 | |||
| 98 | /** |
||
| 99 | * Sets the view object that will generate the admin output. |
||
| 100 | * |
||
| 101 | * @param \Aimeos\MW\View\Iface $view The view object which generates the admin output |
||
| 102 | * @return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls |
||
| 103 | */ |
||
| 104 | public function setView( \Aimeos\MW\View\Iface $view ) : \Aimeos\Admin\JQAdm\Iface |
||
| 108 | } |
||
| 109 | |||
| 110 | |||
| 111 | /** |
||
| 112 | * Copies a resource |
||
| 113 | * |
||
| 114 | * @return string|null Output to display |
||
| 115 | */ |
||
| 116 | public function copy() : ?string |
||
| 117 | { |
||
| 118 | foreach( $this->getSubClients() as $client ) { |
||
| 119 | $client->copy(); |
||
| 120 | } |
||
| 121 | |||
| 122 | return null; |
||
| 123 | } |
||
| 124 | |||
| 125 | |||
| 126 | /** |
||
| 127 | * Creates a new resource |
||
| 128 | * |
||
| 129 | * @return string|null Output to display |
||
| 130 | */ |
||
| 131 | public function create() : ?string |
||
| 132 | { |
||
| 133 | foreach( $this->getSubClients() as $client ) { |
||
| 134 | $client->create(); |
||
| 135 | } |
||
| 136 | |||
| 137 | return null; |
||
| 138 | } |
||
| 139 | |||
| 140 | |||
| 141 | /** |
||
| 142 | * Deletes a resource |
||
| 143 | * |
||
| 144 | * @return string|null Output to display |
||
| 145 | */ |
||
| 146 | public function delete() : ?string |
||
| 147 | { |
||
| 148 | foreach( $this->getSubClients() as $client ) { |
||
| 149 | $client->delete(); |
||
| 150 | } |
||
| 151 | |||
| 152 | return null; |
||
| 153 | } |
||
| 154 | |||
| 155 | |||
| 156 | /** |
||
| 157 | * Exports a resource |
||
| 158 | * |
||
| 159 | * @return string|null Output to display |
||
| 160 | */ |
||
| 161 | public function export() : ?string |
||
| 162 | { |
||
| 163 | foreach( $this->getSubClients() as $client ) { |
||
| 164 | $client->export(); |
||
| 165 | } |
||
| 166 | |||
| 167 | return null; |
||
| 168 | } |
||
| 169 | |||
| 170 | |||
| 171 | /** |
||
| 172 | * Returns a resource |
||
| 173 | * |
||
| 174 | * @return string|null Output to display |
||
| 175 | */ |
||
| 176 | public function get() : ?string |
||
| 177 | { |
||
| 178 | foreach( $this->getSubClients() as $client ) { |
||
| 179 | $client->get(); |
||
| 180 | } |
||
| 181 | |||
| 182 | return null; |
||
| 183 | } |
||
| 184 | |||
| 185 | |||
| 186 | /** |
||
| 187 | * Imports a resource |
||
| 188 | * |
||
| 189 | * @return string|null Output to display |
||
| 190 | */ |
||
| 191 | public function import() : ?string |
||
| 192 | { |
||
| 193 | foreach( $this->getSubClients() as $client ) { |
||
| 194 | $client->import(); |
||
| 195 | } |
||
| 196 | |||
| 197 | return null; |
||
| 198 | } |
||
| 199 | |||
| 200 | |||
| 201 | /** |
||
| 202 | * Saves the data |
||
| 203 | * |
||
| 204 | * @return string|null Output to display |
||
| 205 | */ |
||
| 206 | public function save() : ?string |
||
| 207 | { |
||
| 208 | foreach( $this->getSubClients() as $client ) { |
||
| 209 | $client->save(); |
||
| 210 | } |
||
| 211 | |||
| 212 | return null; |
||
| 213 | } |
||
| 214 | |||
| 215 | |||
| 216 | /** |
||
| 217 | * Returns a list of resource according to the conditions |
||
| 218 | * |
||
| 219 | * @return string|null Output to display |
||
| 220 | */ |
||
| 221 | public function search() : ?string |
||
| 222 | { |
||
| 223 | foreach( $this->getSubClients() as $client ) { |
||
| 224 | $client->search(); |
||
| 225 | } |
||
| 226 | |||
| 227 | return null; |
||
| 228 | } |
||
| 229 | |||
| 230 | |||
| 231 | /** |
||
| 232 | * Adds the decorators to the client object |
||
| 233 | * |
||
| 234 | * @param \Aimeos\Admin\JQAdm\Iface $client Admin object |
||
| 235 | * @param array $decorators List of decorator name that should be wrapped around the client |
||
| 236 | * @param string $classprefix Decorator class prefix, e.g. "\Aimeos\Admin\JQAdm\Catalog\Decorator\" |
||
| 237 | * @return \Aimeos\Admin\JQAdm\Iface Admin object |
||
| 238 | */ |
||
| 239 | protected function addDecorators( \Aimeos\Admin\JQAdm\Iface $client, array $decorators, string $classprefix ) : \Aimeos\Admin\JQAdm\Iface |
||
| 240 | { |
||
| 241 | foreach( $decorators as $name ) |
||
| 242 | { |
||
| 243 | if( ctype_alnum( $name ) === false ) |
||
| 244 | { |
||
| 245 | $classname = is_string( $name ) ? $classprefix . $name : '<not a string>'; |
||
| 246 | throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Invalid class name "%1$s"', $classname ) ); |
||
| 247 | } |
||
| 248 | |||
| 249 | $classname = $classprefix . $name; |
||
| 250 | |||
| 251 | if( class_exists( $classname ) === false ) { |
||
| 252 | throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Class "%1$s" not found', $classname ) ); |
||
| 253 | } |
||
| 254 | |||
| 255 | $client = new $classname( $client, $this->context ); |
||
| 256 | |||
| 257 | \Aimeos\MW\Common\Base::checkClass( '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\Iface', $client ); |
||
| 258 | } |
||
| 259 | |||
| 260 | return $client; |
||
| 261 | } |
||
| 262 | |||
| 263 | |||
| 264 | /** |
||
| 265 | * Adds the decorators to the client object |
||
| 266 | * |
||
| 267 | * @param \Aimeos\Admin\JQAdm\Iface $client Admin object |
||
| 268 | * @param string $path Admin string in lower case, e.g. "catalog/detail/basic" |
||
| 269 | * @return \Aimeos\Admin\JQAdm\Iface Admin object |
||
| 270 | */ |
||
| 271 | protected function addClientDecorators( \Aimeos\Admin\JQAdm\Iface $client, string $path ) : \Aimeos\Admin\JQAdm\Iface |
||
| 272 | { |
||
| 273 | if( !is_string( $path ) || $path === '' ) { |
||
|
|
|||
| 274 | throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Invalid domain "%1$s"', $path ) ); |
||
| 275 | } |
||
| 276 | |||
| 277 | $localClass = str_replace( ' ', '\\', ucwords( str_replace( '/', ' ', $path ) ) ); |
||
| 278 | $config = $this->context->getConfig(); |
||
| 279 | |||
| 280 | $decorators = $config->get( 'admin/jqadm/common/decorators/default', [] ); |
||
| 281 | $excludes = $config->get( 'admin/jqadm/' . $path . '/decorators/excludes', [] ); |
||
| 282 | |||
| 283 | foreach( $decorators as $key => $name ) |
||
| 284 | { |
||
| 285 | if( in_array( $name, $excludes ) ) { |
||
| 286 | unset( $decorators[$key] ); |
||
| 287 | } |
||
| 288 | } |
||
| 289 | |||
| 290 | $classprefix = '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\'; |
||
| 291 | $client = $this->addDecorators( $client, $decorators, $classprefix ); |
||
| 292 | |||
| 293 | $classprefix = '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\'; |
||
| 294 | $decorators = $config->get( 'admin/jqadm/' . $path . '/decorators/global', [] ); |
||
| 295 | $client = $this->addDecorators( $client, $decorators, $classprefix ); |
||
| 296 | |||
| 297 | $classprefix = '\\Aimeos\\Admin\\JQAdm\\' . $localClass . '\\Decorator\\'; |
||
| 298 | $decorators = $config->get( 'admin/jqadm/' . $path . '/decorators/local', [] ); |
||
| 299 | $client = $this->addDecorators( $client, $decorators, $classprefix ); |
||
| 300 | |||
| 301 | return $client; |
||
| 302 | } |
||
| 303 | |||
| 304 | |||
| 305 | /** |
||
| 306 | * Returns the sub-client given by its name. |
||
| 307 | * |
||
| 308 | * @param string $path Name of the sub-part in lower case (can contain a path like catalog/filter/tree) |
||
| 309 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
||
| 310 | * @return \Aimeos\Admin\JQAdm\Iface Sub-part object |
||
| 311 | */ |
||
| 312 | protected function createSubClient( string $path, string $name = null ) : \Aimeos\Admin\JQAdm\Iface |
||
| 341 | } |
||
| 342 | |||
| 343 | |||
| 344 | /** |
||
| 345 | * Returns the value for the given key in the array |
||
| 346 | * |
||
| 347 | * @param array $values Multi-dimensional associative list of key/value pairs |
||
| 348 | * @param string $key Parameter key like "name" or "list/test" for associative arrays |
||
| 349 | * @param mixed $default Returned value if no one for key is available |
||
| 350 | * @return mixed Value from the array or default value if not present in array |
||
| 351 | */ |
||
| 352 | protected function getValue( array $values, $key, $default = null ) |
||
| 353 | { |
||
| 354 | foreach( explode( '/', trim( $key, '/' ) ) as $part ) |
||
| 355 | { |
||
| 356 | if( isset( $values[$part] ) ) { |
||
| 357 | $values = $values[$part]; |
||
| 358 | } else { |
||
| 359 | return $default; |
||
| 360 | } |
||
| 361 | } |
||
| 362 | |||
| 363 | return $values; |
||
| 364 | } |
||
| 365 | |||
| 366 | |||
| 367 | /** |
||
| 368 | * Returns the known client parameters and their values |
||
| 369 | * |
||
| 370 | * @param array $names List of parameter names |
||
| 371 | * @return array Associative list of parameters names as key and their values |
||
| 372 | */ |
||
| 373 | protected function getClientParams( $names = ['id', 'resource', 'site', 'lang'] ) : array |
||
| 374 | { |
||
| 375 | $list = []; |
||
| 376 | |||
| 377 | foreach( $names as $name ) |
||
| 378 | { |
||
| 379 | if( ( $val = $this->view->param( $name ) ) !== null ) { |
||
| 380 | $list[$name] = $val; |
||
| 381 | } |
||
| 382 | } |
||
| 383 | |||
| 384 | return $list; |
||
| 385 | } |
||
| 386 | |||
| 387 | |||
| 388 | /** |
||
| 389 | * Returns the context object. |
||
| 390 | * |
||
| 391 | * @return \Aimeos\MShop\Context\Item\Iface Context object |
||
| 392 | */ |
||
| 393 | protected function getContext() : \Aimeos\MShop\Context\Item\Iface |
||
| 394 | { |
||
| 395 | return $this->context; |
||
| 396 | } |
||
| 397 | |||
| 398 | |||
| 399 | /** |
||
| 400 | * Returns the list of sub-client names configured for the client. |
||
| 401 | * |
||
| 402 | * @return array List of admin client names |
||
| 403 | */ |
||
| 404 | abstract protected function getSubClientNames() : array; |
||
| 405 | |||
| 406 | |||
| 407 | /** |
||
| 408 | * Returns the available class names without namespace that are stored in the given path |
||
| 409 | * |
||
| 410 | * @param string $relpath Path relative to the include paths |
||
| 411 | * @param string[] $excludes List of file names to execlude |
||
| 412 | * @return string[] List of available class names |
||
| 413 | */ |
||
| 414 | protected function getClassNames( string $relpath, array $excludes = ['Base.php', 'Iface.php', 'Example.php', 'None.php'] ) : array |
||
| 415 | { |
||
| 416 | $list = []; |
||
| 417 | |||
| 418 | foreach( $this->getAimeos()->getIncludePaths() as $path ) |
||
| 419 | { |
||
| 420 | $path .= DIRECTORY_SEPARATOR . $relpath; |
||
| 421 | |||
| 422 | if( is_dir( $path ) ) |
||
| 423 | { |
||
| 424 | foreach( new \DirectoryIterator( $path ) as $entry ) |
||
| 425 | { |
||
| 426 | if( $entry->isFile() && !in_array( $entry->getFileName(), $excludes ) ) { |
||
| 427 | $list[] = pathinfo( $entry->getFileName(), PATHINFO_FILENAME ); |
||
| 428 | } |
||
| 429 | } |
||
| 430 | } |
||
| 431 | } |
||
| 432 | |||
| 433 | sort( $list ); |
||
| 434 | return $list; |
||
| 435 | } |
||
| 436 | |||
| 437 | |||
| 438 | /** |
||
| 439 | * Returns the array of criteria conditions based on the given parameters |
||
| 440 | * |
||
| 441 | * @param array $params List of criteria data with condition, sorting and paging |
||
| 442 | * @return array Multi-dimensional associative list of criteria conditions |
||
| 443 | */ |
||
| 444 | protected function getCriteriaConditions( array $params ) : array |
||
| 445 | { |
||
| 446 | $expr = []; |
||
| 447 | |||
| 448 | if( isset( $params['key'] ) ) |
||
| 449 | { |
||
| 450 | foreach( (array) $params['key'] as $idx => $key ) |
||
| 451 | { |
||
| 452 | if( $key != '' && isset( $params['op'][$idx] ) && $params['op'][$idx] != '' |
||
| 453 | && isset( $params['val'][$idx] ) && $params['val'][$idx] != '' |
||
| 454 | ) { |
||
| 455 | $expr[] = [$params['op'][$idx] => [$key => $params['val'][$idx]]]; |
||
| 456 | } |
||
| 457 | } |
||
| 458 | |||
| 459 | if( !empty( $expr ) ) { |
||
| 460 | $expr = ['&&' => $expr]; |
||
| 461 | } |
||
| 462 | } |
||
| 463 | |||
| 464 | return $expr; |
||
| 465 | } |
||
| 466 | |||
| 467 | |||
| 468 | /** |
||
| 469 | * Returns the array of criteria sortations based on the given parameters |
||
| 470 | * |
||
| 471 | * @param array $params List of criteria data with condition, sorting and paging |
||
| 472 | * @return array Associative list of criteria sortations |
||
| 473 | */ |
||
| 474 | protected function getCriteriaSortations( array $params ) : array |
||
| 475 | { |
||
| 476 | $sortation = []; |
||
| 477 | |||
| 478 | foreach( $params as $sort ) |
||
| 479 | { |
||
| 480 | if( $sort[0] === '-' ) { |
||
| 481 | $sortation[substr( $sort, 1 )] = '-'; |
||
| 482 | } else { |
||
| 483 | $sortation[$sort] = '+'; |
||
| 484 | } |
||
| 485 | } |
||
| 486 | |||
| 487 | return $sortation; |
||
| 488 | } |
||
| 489 | |||
| 490 | |||
| 491 | /** |
||
| 492 | * Returns the configured sub-clients or the ones named in the default parameter if none are configured. |
||
| 493 | * |
||
| 494 | * @return array List of sub-clients implementing \Aimeos\Admin\JQAdm\Iface ordered in the same way as the names |
||
| 495 | */ |
||
| 496 | protected function getSubClients() : array |
||
| 508 | } |
||
| 509 | |||
| 510 | |||
| 511 | /** |
||
| 512 | * Initializes the criteria object based on the given parameter |
||
| 513 | * |
||
| 514 | * @param \Aimeos\MW\Criteria\Iface $criteria Criteria object |
||
| 515 | * @param array $params List of criteria data with condition, sorting and paging |
||
| 516 | * @return \Aimeos\MW\Criteria\Iface Initialized criteria object |
||
| 517 | */ |
||
| 518 | protected function initCriteria( \Aimeos\MW\Criteria\Iface $criteria, array $params ) : \Aimeos\MW\Criteria\Iface |
||
| 534 | } |
||
| 535 | |||
| 536 | |||
| 537 | /** |
||
| 538 | * Writes the exception details to the log |
||
| 539 | * |
||
| 540 | * @param \Exception $e Exception object |
||
| 541 | * @return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls |
||
| 542 | */ |
||
| 543 | protected function log( \Exception $e ) : Iface |
||
| 544 | { |
||
| 545 | $logger = $this->context->getLogger(); |
||
| 546 | $logger->log( $e->getMessage(), \Aimeos\MW\Logger\Base::ERR, 'admin/jqadm' ); |
||
| 547 | $logger->log( $e->getTraceAsString(), \Aimeos\MW\Logger\Base::ERR, 'admin/jqadm' ); |
||
| 548 | |||
| 549 | return $this; |
||
| 550 | } |
||
| 551 | |||
| 552 | |||
| 553 | /** |
||
| 554 | * Returns a map of code/item pairs |
||
| 555 | * |
||
| 556 | * @param \Aimeos\MShop\Common\Item\Type\Iface[] $items Associative list of type items |
||
| 557 | * @return \Aimeos\MShop\Common\Item\Type\Iface[] Associative list of codes as keys and items as values |
||
| 558 | */ |
||
| 559 | protected function map( \Aimeos\Map $items ) : array |
||
| 568 | } |
||
| 569 | |||
| 570 | |||
| 571 | /** |
||
| 572 | * Adds a redirect to the response for the next action |
||
| 573 | * |
||
| 574 | * @param \Aimeos\MW\View\Iface $view View object |
||
| 575 | * @param string|null $action Next action |
||
| 576 | * @param string $resource Resource name |
||
| 577 | * @param string|null $id ID of the next resource item |
||
| 578 | * @param string|null $act Current action name |
||
| 579 | * @return \Aimeos\MW\View\Iface Modified view object |
||
| 580 | */ |
||
| 581 | protected function nextAction( \Aimeos\MW\View\Iface $view, ?string $action, string $resource, |
||
| 629 | } |
||
| 630 | |||
| 631 | |||
| 632 | /** |
||
| 633 | * Writes the exception details to the log |
||
| 634 | * |
||
| 635 | * @param \Exception $e Exception object |
||
| 636 | * @param string $method Method it's called from |
||
| 637 | * @return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls |
||
| 638 | */ |
||
| 639 | protected function report( \Exception $e, string $method ) : Iface |
||
| 665 | } |
||
| 666 | |||
| 667 | |||
| 668 | /** |
||
| 669 | * Stores and returns the parameters used for searching items |
||
| 670 | * |
||
| 671 | * @param array $params GET/POST parameter set |
||
| 672 | * @param string $name Name of the panel/subpanel |
||
| 673 | * @return array Associative list of parameters for searching items |
||
| 674 | */ |
||
| 675 | protected function storeSearchParams( array $params, string $name ) : array |
||
| 676 | { |
||
| 677 | $key = 'aimeos/admin/jqadm/' . $name; |
||
| 678 | $session = $this->getContext()->getSession(); |
||
| 679 | |||
| 680 | if( isset( $params['filter'] ) ) { |
||
| 681 | $session->set( $key . '/filter', $params['filter'] ); |
||
| 682 | } |
||
| 683 | |||
| 684 | if( isset( $params['sort'] ) ) { |
||
| 685 | $session->set( $key . '/sort', $params['sort'] ); |
||
| 686 | } |
||
| 687 | |||
| 688 | if( isset( $params['page'] ) ) { |
||
| 689 | $session->set( $key . '/page', $params['page'] ); |
||
| 690 | } |
||
| 691 | |||
| 692 | if( isset( $params['fields'] ) ) { |
||
| 693 | $session->set( $key . '/fields', $params['fields'] ); |
||
| 694 | } |
||
| 695 | |||
| 696 | return [ |
||
| 697 | 'fields' => $session->get( $key . '/fields' ), |
||
| 698 | 'filter' => $session->get( $key . '/filter' ), |
||
| 699 | 'page' => $session->get( $key . '/page' ), |
||
| 700 | 'sort' => $session->get( $key . '/sort' ), |
||
| 701 | ]; |
||
| 702 | } |
||
| 703 | |||
| 704 | |||
| 705 | /** |
||
| 706 | * Initializes the criteria object with conditions based on the given parameter |
||
| 707 | * |
||
| 708 | * @param \Aimeos\MW\Criteria\Iface $criteria Criteria object |
||
| 709 | * @param array $params List of criteria data with condition, sorting and paging |
||
| 710 | * @return \Aimeos\MW\Criteria\Iface Initialized criteria object |
||
| 711 | */ |
||
| 712 | private function initCriteriaConditions( \Aimeos\MW\Criteria\Iface $criteria, array $params ) : \Aimeos\MW\Criteria\Iface |
||
| 719 | } |
||
| 720 | |||
| 721 | |||
| 722 | /** |
||
| 723 | * Initializes the criteria object with the slice based on the given parameter. |
||
| 724 | * |
||
| 725 | * @param \Aimeos\MW\Criteria\Iface $criteria Criteria object |
||
| 726 | * @param array $params List of criteria data with condition, sorting and paging |
||
| 727 | * @return \Aimeos\MW\Criteria\Iface Initialized criteria object |
||
| 728 | */ |
||
| 729 | private function initCriteriaSlice( \Aimeos\MW\Criteria\Iface $criteria, array $params ) : \Aimeos\MW\Criteria\Iface |
||
| 735 | } |
||
| 736 | |||
| 737 | |||
| 738 | /** |
||
| 739 | * Initializes the criteria object with sortations based on the given parameter |
||
| 740 | * |
||
| 741 | * @param \Aimeos\MW\Criteria\Iface $criteria Criteria object |
||
| 742 | * @param array $params List of criteria data with condition, sorting and paging |
||
| 743 | * @return \Aimeos\MW\Criteria\Iface Initialized criteria object |
||
| 744 | */ |
||
| 745 | private function initCriteriaSortations( \Aimeos\MW\Criteria\Iface $criteria, array $params ) : \Aimeos\MW\Criteria\Iface |
||
| 750 |