QureyBasedTable: move to ipl

This commit is contained in:
Thomas Gelf 2017-06-22 09:46:12 +02:00
parent f3a11213f7
commit 9845cddcb4
11 changed files with 24 additions and 17 deletions

View File

@ -7,9 +7,10 @@ use Icinga\Exception\IcingaException;
use Icinga\Module\Director\IcingaConfig\AssignRenderer;
use ipl\Html\Icon;
use ipl\Html\Link;
use ipl\Web\Table\ZfQueryBasedTable;
use ipl\Web\Url;
class ApplyRulesTable extends QueryBasedTable
class ApplyRulesTable extends ZfQueryBasedTable
{
protected $searchColumns = [
'o.object_name',

View File

@ -5,9 +5,10 @@ namespace Icinga\Module\Director\Web\Table;
use Icinga\Module\Director\Db;
use ipl\Html\Link;
use ipl\Web\Component\ControlsAndContent;
use ipl\Web\Table\ZfQueryBasedTable;
use ipl\Web\Url;
class ChoicesTable extends QueryBasedTable
class ChoicesTable extends ZfQueryBasedTable
{
protected $searchColumns = ['o.object_name'];

View File

@ -4,9 +4,10 @@ namespace Icinga\Module\Director\Web\Table;
use Icinga\Module\Director\Db;
use ipl\Html\Link;
use ipl\Web\Table\ZfQueryBasedTable;
use ipl\Web\Url;
class ObjectSetTable extends QueryBasedTable
class ObjectSetTable extends ZfQueryBasedTable
{
protected $searchColumns = [
'os.object_name',

View File

@ -8,10 +8,11 @@ use Icinga\Module\Director\Objects\IcingaObject;
use Icinga\Module\Director\Restriction\HostgroupRestriction;
use Icinga\Module\Director\Restriction\ObjectRestriction;
use ipl\Html\Link;
use ipl\Web\Table\ZfQueryBasedTable;
use ipl\Web\Url;
use Zend_Db_Select as ZfSelect;
class ObjectsTable extends QueryBasedTable
class ObjectsTable extends ZfQueryBasedTable
{
/** @var ObjectRestriction[] */
protected $objectRestrictions;

View File

@ -2,7 +2,7 @@
namespace Icinga\Module\Director\Web\Table;
use Icinga\Module\Director\Web\Table\Extension\MultiSelect;
use ipl\Web\Table\Extension\MultiSelect;
class ObjectsTableHost extends ObjectsTable
{

View File

@ -2,10 +2,9 @@
namespace Icinga\Module\Director\Web\Table;
use Icinga\Module\Director\Db;
use Icinga\Module\Director\Db\IcingaObjectFilterHelper;
use Icinga\Module\Director\Objects\IcingaService;
use Icinga\Module\Director\Web\Table\Extension\MultiSelect;
use ipl\Web\Table\Extension\MultiSelect;
use ipl\Html\Link;
use ipl\Web\Url;

View File

@ -8,9 +8,10 @@ use Icinga\Module\Director\IcingaConfig\AssignRenderer;
use ipl\Html\Icon;
use ipl\Html\Link;
use ipl\Html\Table;
use ipl\Web\Table\ZfQueryBasedTable;
use ipl\Web\Url;
class ServiceApplyRulesTable extends QueryBasedTable
class ServiceApplyRulesTable extends ZfQueryBasedTable
{
protected $searchColumns = [
's.object_name',

View File

@ -6,9 +6,10 @@ use Icinga\Module\Director\Db;
use ipl\Html\Html;
use ipl\Html\Icon;
use ipl\Html\Link;
use ipl\Web\Table\ZfQueryBasedTable;
use ipl\Web\Url;
class TemplatesTable extends QueryBasedTable
class TemplatesTable extends ZfQueryBasedTable
{
protected $searchColumns = ['o.object_name'];

View File

@ -1,6 +1,6 @@
<?php
namespace Icinga\Module\Director\Web\Table\Extension;
namespace ipl\Web\Table\Extension;
use ipl\Web\Url;

View File

@ -1,6 +1,6 @@
<?php
namespace Icinga\Module\Director\Web\Table\Extension;
namespace ipl\Web\Table\Extension;
use ipl\Html\BaseElement;
use ipl\Html\Html;

View File

@ -1,10 +1,9 @@
<?php
namespace Icinga\Module\Director\Web\Table;
namespace ipl\Web\Table;
use Icinga\Data\Db\DbConnection;
use Icinga\Data\Filter\Filter;
use Icinga\Module\Director\Db;
use Icinga\Module\Director\Web\Table\Extension\QuickSearch;
use ipl\Db\Zf1\FilterRenderer;
use ipl\Db\Zf1\SelectPaginationAdapter;
use ipl\Html\Container;
@ -15,9 +14,10 @@ use ipl\Html\Table;
use ipl\Translation\TranslationHelper;
use ipl\Web\Component\ControlsAndContent;
use ipl\Web\Component\Paginator;
use ipl\Web\Table\Extension\QuickSearch;
use ipl\Web\Url;
abstract class QueryBasedTable extends Table
abstract class ZfQueryBasedTable extends Table
{
use TranslationHelper;
use QuickSearch;
@ -27,15 +27,17 @@ abstract class QueryBasedTable extends Table
'data-base-target' => '_next',
];
/** @var DbConnection */
private $connection;
/** @var \Zend_Db_Adapter_Abstract */
private $db;
private $query;
protected $searchColumns = [];
public function __construct(Db $connection)
public function __construct(DbConnection $connection)
{
$this->connection = $connection;
$this->db = $connection->getDbAdapter();
@ -158,7 +160,7 @@ abstract class QueryBasedTable extends Table
]);
}
public static function show(ControlsAndContent $controller, Db $db)
public static function show(ControlsAndContent $controller, DbConnection $db)
{
$table = new static($db);
$table->renderTo($controller);