Type Ratings | New Feature (#1360)
* Type Ratings Adding "Type Rating" definition and assignment possibility to v7 core. * Update ProfileController.php * StyleFix 1 * Update settings.yml Change description text as requested
This commit is contained in:
43
app/Repositories/TypeRatingRepository.php
Normal file
43
app/Repositories/TypeRatingRepository.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Contracts\Repository;
|
||||
use App\Models\Typerating;
|
||||
use Prettus\Repository\Contracts\CacheableInterface;
|
||||
use Prettus\Repository\Traits\CacheableRepository;
|
||||
|
||||
class TypeRatingRepository extends Repository implements CacheableInterface
|
||||
{
|
||||
use CacheableRepository;
|
||||
|
||||
protected $fieldSearchable = [
|
||||
'name' => 'like',
|
||||
'type' => 'like',
|
||||
];
|
||||
|
||||
public function model()
|
||||
{
|
||||
return Typerating::class;
|
||||
}
|
||||
|
||||
public function selectBoxList($add_blank = false, $only_active = true): array
|
||||
{
|
||||
$retval = [];
|
||||
$where = [
|
||||
'active' => $only_active,
|
||||
];
|
||||
|
||||
$items = $this->findWhere($where);
|
||||
|
||||
if ($add_blank) {
|
||||
$retval[''] = '';
|
||||
}
|
||||
|
||||
foreach ($items as $i) {
|
||||
$retval[$i->id] = $i->name;
|
||||
}
|
||||
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user