| 1 | <?php |
||
| 18 | 1 | class CategoryModel extends BaseModel |
|
| 19 | { |
||
| 20 | /** @var array */ |
||
| 21 | public $dbColumns = [ |
||
| 22 | 'name', |
||
| 23 | 'bgcolor', |
||
| 24 | 'bocolor', |
||
| 25 | 'focolor', |
||
| 26 | ]; |
||
| 27 | |||
| 28 | /** @var string */ |
||
| 29 | protected $table = 'kk_categories'; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param Nette\Database\Context $database |
||
| 33 | */ |
||
| 34 | public function __construct(Context $database, Cache $cache) |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param array $data |
||
| 42 | * @return boolean |
||
| 43 | */ |
||
| 44 | public function create(array $data) |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @param integer $id |
||
| 53 | * @param array $data |
||
| 54 | * @return boolean |
||
| 55 | */ |
||
| 56 | public function update($id, array $data) |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @param integer $id |
||
| 65 | * @return Nette\Database\Table\ActiveRow |
||
| 66 | */ |
||
| 67 | public function find($id) |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @return array |
||
| 78 | */ |
||
| 79 | public function all(): array |
||
| 87 | |||
| 88 | /** |
||
| 89 | * @param string $name |
||
| 90 | * @return string |
||
| 91 | */ |
||
| 92 | protected function getStyleFromName($name) |
||
| 99 | |||
| 100 | } |
||
| 101 |