Delete   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A obtainGenerateOrder() 0 8 1
A defineQueriesParts() 0 7 1
1
<?php
2
3
namespace BfwSql\Queries;
4
5
/**
6
 * Class to write DELETE queries
7
 * 
8
 * @package bfw-sql
9
 * @author Vermeulen Maxime <[email protected]>
10
 * @version 2.0
11
 * 
12
 * @method \BfwSql\Queries\Delete from(string|array $nameInfos, string|array|null $columns=null)
13
 */
14
class Delete extends AbstractQuery
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19
    protected $requestType = 'delete';
20
    
21
    /**
22
     * {@inheritdoc}
23
     */
24
    protected function defineQueriesParts()
25
    {
26
        parent::defineQueriesParts();
27
        
28
        $this->queriesParts['from'] = $this->queriesParts['table'];
29
        
30
        $this->querySgbd->disableQueriesParts($this->queriesParts);
31
    }
32
    
33
    /**
34
     * {@inheritdoc}
35
     */
36
    protected function obtainGenerateOrder(): array
37
    {
38
        return [
39
            'from' => [
40
                'prefix'     => 'DELETE FROM',
41
                'canBeEmpty' => false
42
            ],
43
            'where' => []
44
        ];
45
    }
46
}
47