Conditions | 6 |
Paths | 16 |
Total Lines | 27 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | public function __construct($params) |
||
28 | { |
||
29 | /* |
||
30 | * FIXME this is really meant to be "if they didn't specify something, |
||
31 | * assume they meant posts" -- not sure that this the best way of |
||
32 | * saying that, though |
||
33 | */ |
||
34 | if (!isset($params['posts']) && !isset($params['pages'])) { |
||
35 | $params['posts'] = true; |
||
36 | } |
||
37 | |||
38 | $params['posts'] = $this->forceBooleanParameter($params, 'posts'); |
||
39 | $params['pages'] = $this->forceBooleanParameter($params, 'pages'); |
||
40 | |||
41 | if (!isset($params['icon'])) { |
||
42 | $params['icon'] = 'https://s.w.org/favicon.ico?2'; |
||
43 | } |
||
44 | |||
45 | parent::__construct($params); |
||
46 | |||
47 | if ($params['posts']) { |
||
48 | $this->addDomain(new PostsSearch($params)); |
||
49 | } |
||
50 | if ($params['pages']) { |
||
51 | $this->addDomain(new PagesSearch($params)); |
||
52 | } |
||
53 | } |
||
54 | } |
||
55 |