<?php
namespace Modules\Admin\Config\CorporateCollectionProfiles; class Model extends \App\Mvc\Model_ListingAbstract { public function list_execute(\App\Mvc\View\Listing\Members\Params $listingParams) { $list = []; $filters = $listingParams->getFilters(); $cfgAdmin = \App\Config\CorporateCollectionProfiles::getAdmin(); foreach ($cfgAdmin->getAll() as $id => $profileDetails) { if ($filters['name'] and mb_strpos(mb_strtolower($profileDetails['name']), mb_strtolower($filters['name']))===false) { continue; } if ($filters['attachment'] and $profileDetails['attachment']!=$filters['attachment']) { continue; } $list[] = [ 'id' => $id, 'name' => $profileDetails['name'], 'attachment' => $this->globalLang['corporateCollection']['attachments'][$profileDetails['attachment']], 'emailSubject' => $profileDetails['emailSubject'], 'default' => ($cfgAdmin->getDefaultItem()==$id), 'recipientToAuto' => $profileDetails['recipientToAuto'], 'recipientToManual' => $profileDetails['recipientToManual'], 'recipientBccManual' => $profileDetails['recipientBccManual'], 'dueInDaysPeriod' => $profileDetails['dueInDaysPeriod'], ]; } $this->totalRecordsCount = count($list); $this->recordsList = $list; } }