Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 4 |
| PhotoCategory | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
12 | |
0.00% |
0 / 4 |
| descriptions | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 3 |
|||
| photos | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| <?php | |
| namespace App; | |
| use Illuminate\Database\Eloquent\Model; | |
| use Illuminate\Database\Eloquent\Relations\HasMany; | |
| use Illuminate\Database\Eloquent\SoftDeletes; | |
| class PhotoCategory extends Model | |
| { | |
| // use soft delete | |
| use SoftDeletes; | |
| /** | |
| * Return descriptions for website gallery | |
| * @param int $language_id | |
| * @return HasMany | |
| */ | |
| public function descriptions($language_id = 0) : HasMany | |
| { | |
| if ($language_id) { | |
| return $this->hasMany(PhotoCategoryDescription::class)->where('language_id', $language_id); | |
| } | |
| return $this->hasMany(PhotoCategoryDescription::class); | |
| } | |
| /** | |
| * Return photos for category | |
| * @return HasMany | |
| */ | |
| public function photos() :HasMany | |
| { | |
| return $this->hasMany(Photo::class); | |
| } | |
| } |