<?php
namespace Modules\Admin\Config\ClientInvoices\RowsDescriptions; class Model extends \App\Mvc\Model_ListingAbstract { public function list_execute(\App\Mvc\View\Listing\Members\Params $listingParams) { $list = []; $filters = $listingParams->getFilters(); foreach (\App\Config\InvoiceRowsDescription::getAdmin()->getSchemesName() as $name) { if ($filters['name'] && strpos(mb_strtolower($name), mb_strtolower($filters['name']))===false) { continue; } if($name) { $list[$name] = [ 'id' => $name ]; } } $defaultSchema = \App\Config\InvoiceRowsDescription::getAdmin()->getDefaultItem(); if (array_key_exists($defaultSchema,$list)) { $list[$defaultSchema]['default'] = true; } $this->totalRecordsCount = count($list); $this->recordsList = $list; } }