11<?php /** @noinspection SqlNoDataSourceInspection */
22
3+ use DBA \Config ;
34use DBA \Factory ;
5+ use DBA \QueryFilter ;
46
57if (!isset ($ PRESENT ["v0.14.x_pagination " ])) {
6- Factory::getAgentFactory ()->getDB ()->query ("INSERT INTO `Config` (`configId`, `configSectionId`, `item`, `value`) VALUES
7- (78, 3, 'defaultPageSize', '10000'); " );
8- Factory::getAgentFactory ()->getDB ()->query ("INSERT INTO `Config` (`configId`, `configSectionId`, `item`, `value`) VALUES
9- (79, 3, 'maxPageSize', '50000'); " );
10- $ EXECUTED ["v0.14.x_pagination " ];
8+ $ qF = new QueryFilter (Config::ITEM , DConfig::DEFAULT_PAGE_SIZE , "= " );
9+ $ item = Factory::getConfigFactory ()->filter ([Factory::FILTER => $ qF ], true );
10+ if (!$ item ) {
11+ $ config = new Config (null , 3 , DConfig::DEFAULT_PAGE_SIZE , '10000 ' );
12+ Factory::getConfigFactory ()->save ($ config );
13+ }
14+ $ qF = new QueryFilter (Config::ITEM , DConfig::MAX_PAGE_SIZE , "= " );
15+ $ item = Factory::getConfigFactory ()->filter ([Factory::FILTER => $ qF ], true );
16+ if (!$ item ) {
17+ $ config = new Config (null , 3 , DConfig::MAX_PAGE_SIZE , '50000 ' );
18+ Factory::getConfigFactory ()->save ($ config );
19+ }
1120}
0 commit comments