| 1 | <?php |
||
| 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) |
||
| 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) |
||
| 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) |
||
| 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) |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return array |
||
| 61 | * @see DataManagerInterface |
||
| 62 | */ |
||
| 63 | final public function getMessages() |
||
| 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') |
||
| 77 | } |
||
| 78 |