ListQuery::andWhereBoard()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace carono\yii2trello\query;
5
6
7
use carono\yii2trello\Board;
8
9
/**
10
 * Class ListQuery
11
 *
12
 * @package carono\yii2trello\query
13
 */
14
class ListQuery extends Query
15
{
16
    protected $board;
17
18
    /**
19
     * @param $id
20
     * @return $this
21
     */
22
    public function andWhereBoard($id)
23
    {
24
        $this->board = $id;
25
        return $this;
26
    }
27
28
    protected function fetchData(): array
29
    {
30
        $board = Board::find()->andWhereMember($this->member)->andWhere(['id' => $this->board])->one($this->client);
31
        $this->from = $board ? $board->getLists() : [];
32
        return parent::fetchData();
33
    }
34
}