Delete::obtainGenerateOrder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

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