Completed
Branch feature/pre-split (540d96)
by Anton
03:41
created

UpdateCommand::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * components
4
 *
5
 * @author    Wolfy-J
6
 */
7
namespace Spiral\ORM\Commands;
8
9
class UpdateCommand extends TableCommand
10
{
11
    /**
12
     * Where conditions (short where format).
13
     *
14
     * @var array
15
     */
16
    private $where = [];
17
18
    private $context = [];
19
20
    /**
21
     * @param array $where
22
     */
23
    public function setWhere(array $where)
24
    {
25
        $this->where = $where;
26
    }
27
28
    /**
29
     * Inserting data into associated table.
30
     */
31
    public function execute()
32
    {
33
        $this->table->update($this->context, $this->where)->run();
34
        parent::execute();
35
    }
36
}