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

Delete::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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