vendor/pimcore/pimcore/models/Staticroute/Listing/Dao.php line 33

Open in your IDE?
  1. <?php
  2. /**
  3.  * Pimcore
  4.  *
  5.  * This source file is available under two different licenses:
  6.  * - GNU General Public License version 3 (GPLv3)
  7.  * - Pimcore Commercial License (PCL)
  8.  * Full copyright and license information is available in
  9.  * LICENSE.md which is distributed with this source code.
  10.  *
  11.  *  @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  12.  *  @license    http://www.pimcore.org/license     GPLv3 and PCL
  13.  */
  14. namespace Pimcore\Model\Staticroute\Listing;
  15. use Pimcore\Model;
  16. /**
  17.  * @internal
  18.  *
  19.  * @property \Pimcore\Model\Staticroute\Listing $model
  20.  */
  21. class Dao extends Model\Staticroute\Dao
  22. {
  23.     /**
  24.      * @return array
  25.      */
  26.     public function loadList()
  27.     {
  28.         $staticRoutes = [];
  29.         foreach ($this->loadIdList() as $id) {
  30.             $staticRoutes[] = Model\Staticroute::getById($id);
  31.         }
  32.         if ($this->model->getFilter()) {
  33.             $staticRoutes array_filter($staticRoutes$this->model->getFilter());
  34.         }
  35.         if ($this->model->getOrder()) {
  36.             usort($staticRoutes$this->model->getOrder());
  37.         }
  38.         $this->model->setRoutes($staticRoutes);
  39.         return $staticRoutes;
  40.     }
  41.     /**
  42.      * @return int
  43.      */
  44.     public function getTotalCount()
  45.     {
  46.         return count($this->loadList());
  47.     }
  48. }