Completed
Push — 2.0 ( 1160ec...acba87 )
by Vermeulen
05:15
created

Delete   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 26
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A defineQueriesParts() 0 6 1
A obtainGenerateOrder() 0 10 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
class Delete extends AbstractQuery
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    protected function defineQueriesParts()
18
    {
19
        parent::defineQueriesParts();
20
        
21
        $this->queriesParts['from'] = $this->queriesParts['table'];
22
    }
23
    
24
    /**
25
     * {@inheritdoc}
26
     */
27
    protected function obtainGenerateOrder(): array
28
    {
29
        return [
30
            'from' => [
31
                'prefix'     => 'DELETE FROM',
32
                'canBeEmpty' => false
33
            ],
34
            'where' => []
35
        ];
36
    }
37
}
38