Completed
Push — master ( c18000...efec97 )
by Anton
12s
created

Grid   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 25
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 12 1
1
<?php
2
/**
3
 * @copyright Bluz PHP Team
4
 * @link https://github.com/bluzphp/skeleton
5
 */
6
7
/**
8
 * @namespace
9
 */
10
namespace Application\Pages;
11
12
use Bluz\Grid\Source\SqlSource;
13
14
/**
15
 * Grid of Pages
16
 *
17
 * @package  Application\Pages
18
 */
19
class Grid extends \Bluz\Grid\Grid
20
{
21
    /**
22
     * @var string
23
     */
24
    protected $uid = 'pages';
25
26
    /**
27
     * init
28
     *
29
     * @return self
30
     */
31 1
    public function init()
32
    {
33
         // Setup source
34 1
         $adapter = new SqlSource();
35 1
         $adapter->setSource('SELECT * FROM pages');
36
37 1
         $this->setAdapter($adapter);
38 1
         $this->setDefaultLimit(25);
39 1
         $this->setAllowOrders(['title', 'id', 'created', 'updated']);
40 1
         $this->setAllowFilters(['title', 'alias', 'description', 'content', 'id']);
41 1
         return $this;
42
    }
43
}
44