Completed
Push — master ( 037c01...3910ea )
by Oscar
01:42
created

Delete   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 5
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace SimpleCrud\Queries;
5
6
use SimpleCrud\Table;
7
8
final class Delete extends Query
9
{
10
    use Traits\HasRelatedWith;
11
12
    protected const ALLOWED_METHODS = [
13
        'setFlag',
14
        'where',
15
        'orWhere',
16
        'catWhere',
17
        'orderBy',
18
        'limit',
19
        'offset',
20
    ];
21
22
    public function __construct(Table $table)
23
    {
24
        $this->table = $table;
25
26
        $this->query = $table->getDatabase()
27
            ->delete()
28
            ->from((string) $table);
29
    }
30
}
31