| Total Complexity | 11 |
| Total Lines | 67 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class ModulesRepo |
||
| 8 | { |
||
| 9 | public static function getControllerName($moduleId) |
||
| 12 | } |
||
| 13 | |||
| 14 | public static function find($id) |
||
| 17 | } |
||
| 18 | |||
| 19 | private static function where($conditions) |
||
| 20 | { |
||
| 21 | return DB::table('cms_moduls')->where($conditions); |
||
| 22 | } |
||
| 23 | |||
| 24 | public static function getByTableName($table) |
||
| 25 | { |
||
| 26 | return self::first(['table_name' => $table]); |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param $path |
||
| 31 | * @return mixed |
||
| 32 | */ |
||
| 33 | public static function modulePathExists($path) |
||
| 34 | { |
||
| 35 | return (boolean) self::count(['path' => $path, 'deleted_at' => null]); |
||
| 36 | } |
||
| 37 | |||
| 38 | public static function updateById($id, $data) |
||
| 39 | { |
||
| 40 | return self::where(['id' => $id])->update($data); |
||
| 41 | } |
||
| 42 | |||
| 43 | public static function getByPath($modulepath) |
||
| 46 | } |
||
| 47 | |||
| 48 | public static function countByPath($modulepath) |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @param $conditions |
||
| 55 | * @return mixed |
||
| 56 | */ |
||
| 57 | private static function first($conditions) |
||
| 58 | { |
||
| 59 | return self::where($conditions)->first(); |
||
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @param $conditions |
||
| 64 | * @return mixed |
||
| 65 | */ |
||
| 66 | private static function count($conditions) |
||
| 67 | { |
||
| 68 | return self::where($conditions)->count(); |
||
| 69 | } |
||
| 70 | |||
| 71 | public static function getAll($cols = null) |
||
| 74 | } |
||
| 75 | } |