Completed
Push — master ( 2da229...6c27e6 )
by Hamidreza
01:12
created

FileFilters::flag()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Hamidrezaniazi\Upolo\Filters;
4
5
class FileFilters extends Filters
6
{
7
    /**
8
     * Registered filters to operate upon.
9
     *
10
     * @var array
11
     */
12
    protected $filters = ['owner_type', 'owner_id', 'creator_id', 'type', 'flag'];
13
14
    /**
15
     * @param string $ownerType
16
     * @return mixed
17
     */
18
    protected function owner_type(string $ownerType)
19
    {
20
        return $this->builder->whereOwnerTypeIs($ownerType);
21
    }
22
23
    /**
24
     * @param int $ownerId
25
     * @return mixed
26
     */
27
    protected function owner_id(int $ownerId)
28
    {
29
        return $this->builder->whereOwnerIdIs($ownerId);
30
    }
31
32
    /**
33
     * @param int $creatorId
34
     * @return mixed
35
     */
36
    protected function creator_id(int $creatorId)
37
    {
38
        return $this->builder->whereCreatorIdIs($creatorId);
39
    }
40
41
    /**
42
     * @param string $type
43
     * @return mixed
44
     */
45
    protected function type(string $type)
46
    {
47
        return $this->builder->whereTypeIs($type);
48
    }
49
50
    /**
51
     * @param string $flag
52
     * @return mixed
53
     */
54
    protected function flag(string $flag)
55
    {
56
        return $this->builder->whereFlagIs($flag);
57
    }
58
}
59