Completed
Push — master ( 6d1120...3e38c4 )
by Michal
10s
created

AbstractDataManager::deleteItem()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 3
crap 2
1
<?php
2
3
namespace UniMan\Core\DataManager;
4
5
abstract class AbstractDataManager implements DataManagerInterface
6
{
7
    /**
8
     * @var array list of messages in format flash message => type of flash message (info, success, warning, danger)
9
     */
10
    protected $messages = [];
11
12
    /**
13
     * Implement this method if permission canDeleteItem is true
14
     * @param string $type
15
     * @param string $table
16
     * @param string $item
17
     * @return boolean|null
18
     * @see DataManagerInterface
19
     */
20
    public function deleteItem($type, $table, $item)
21
    {
22
        return null;
23
    }
24
25
    /**
26
     * Implement this method if permission canDeleteTable is true
27
     * @param string $type
28
     * @param string $table
29
     * @return boolean|null
30
     * @see DataManagerInterface
31
     */
32
    public function deleteTable($type, $table)
33
    {
34
        return null;
35
    }
36
37
    /**
38
     * Implement this method if permission canDeleteDatabase is true
39
     * @param string $database
40
     * @return boolean|null
41
     * @see DataManagerInterface
42
     */
43
    public function deleteDatabase($database)
44
    {
45
        return null;
46
    }
47
48
    /**
49
     * Implement this method if permission canExecuteCommands is true
50
     * @param string $commands
51
     * @return array|null
52
     * @see DataManagerInterface
53
     */
54
    public function execute($commands)
55
    {
56
        return null;
57
    }
58
59
    /**
60
     * @return array
61
     * @see DataManagerInterface
62
     */
63
    final public function getMessages()
64
    {
65
        return $this->messages;
66
    }
67
68
    /**
69
     * add message to list of messages
70
     * @param string $message
71
     * @param string $type
72
     */
73
    final protected function addMessage($message, $type = 'info')
74
    {
75
        $this->messages[$message] = $type;
76
    }
77
}
78