Completed
Branch feature/pre-split (c69968)
by Anton
21:25
created

DeleteCommand::setWhere()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * components
4
 *
5
 * @author    Wolfy-J
6
 */
7
namespace Spiral\ORM\Commands;
8
9
use Spiral\Database\Entities\Table;
10
use Spiral\ORM\Commands\Traits\WhereTrait;
11
12
class DeleteCommand extends TableCommand
13
{
14
    use WhereTrait;
15
16
    /**
17
     * @param Table $table
18
     * @param mixed $where
19
     */
20
    public function __construct(Table $table, array $where)
21
    {
22
        parent::__construct($table);
23
        $this->where = $where;
24
    }
25
26
    /**
27
     * Inserting data into associated table.
28
     */
29
    public function execute()
30
    {
31
        $this->table->delete($this->where)->run();
32
        parent::execute();
33
    }
34
}