| Total Complexity | 5 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 8 | class H5pLibrary extends Model |
||
| 9 | { |
||
| 10 | protected $primaryKey = 'id'; |
||
| 11 | protected $fillable = [ |
||
| 12 | 'name', |
||
| 13 | 'title', |
||
| 14 | 'major_version', |
||
| 15 | 'minor_version', |
||
| 16 | 'patch_version', |
||
| 17 | 'runnable', |
||
| 18 | 'restricted', |
||
| 19 | 'fullscreen', |
||
| 20 | 'embed_types', |
||
| 21 | 'preloaded_js', |
||
| 22 | 'preloaded_css', |
||
| 23 | 'drop_library_css', |
||
| 24 | 'semantics', |
||
| 25 | 'tutorial_url', |
||
| 26 | 'has_icon', |
||
| 27 | 'created_at', |
||
| 28 | 'updated_at', |
||
| 29 | ]; |
||
| 30 | |||
| 31 | public function numContent() |
||
| 32 | { |
||
| 33 | $h5p = App::make('LaravelH5p'); |
||
| 34 | $interface = $h5p::$interface; |
||
| 35 | |||
| 36 | return intval($interface->getNumContent($this->id)); |
||
| 37 | } |
||
| 38 | |||
| 39 | public function getCountContentDependencies() |
||
| 40 | { |
||
| 41 | $h5p = App::make('LaravelH5p'); |
||
| 42 | $interface = $h5p::$interface; |
||
| 43 | $usage = $interface->getLibraryUsage($this->id, $interface->getNumNotFiltered() ? true : false); |
||
| 44 | |||
| 45 | return intval($usage['content']); |
||
| 46 | } |
||
| 47 | |||
| 48 | public function getCountLibraryDependencies() |
||
| 55 | } |
||
| 56 | } |
||
| 57 |