OrganizationIndex::createQuery()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 0
cts 9
cp 0
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/organization/license
6
 * @link       https://www.flipboxfactory.com/software/organization/
7
 */
8
9
namespace flipbox\organizations\actions\organizations;
10
11
use flipbox\craft\ember\actions\elements\ElementIndex;
12
use flipbox\craft\ember\helpers\QueryHelper;
13
use flipbox\organizations\elements\Organization;
14
use flipbox\organizations\queries\OrganizationQuery;
15
use yii\db\QueryInterface;
16
17
/**
18
 * @author Flipbox Factory <[email protected]>
19
 * @since 1.0.0
20
 */
21
class OrganizationIndex extends ElementIndex
22
{
23
    /**
24
     * @inheritdoc
25
     * @return OrganizationQuery
26
     */
27
    public function createQuery(array $config = []): QueryInterface
28
    {
29
        $query = Organization::find();
30
31
        QueryHelper::configure(
32
            $query,
33
            $config
34
        );
35
36
        return $query;
37
    }
38
}
39