36 lines
904 B
PHP
36 lines
904 B
PHP
<?php
|
|
|
|
namespace App\Repositories;
|
|
|
|
use App\Models\Advertisements;
|
|
use App\Repositories\Interface\AdvertisementInterface;
|
|
|
|
|
|
class AdvertisementRepository implements AdvertisementInterface
|
|
{
|
|
|
|
public function getAll()
|
|
{
|
|
return Advertisements::where('status', '<>', -1)->orderBy('display_order')->get();
|
|
}
|
|
|
|
public function getAdvertisementById($advertisementId)
|
|
{
|
|
return Advertisements::where('advertisement_id', $advertisementId)->first();
|
|
}
|
|
|
|
public function delete($advertisementId)
|
|
{
|
|
return Advertisements::where('advertisement_id', $advertisementId)->delete();
|
|
}
|
|
|
|
public function create(array $newData)
|
|
{
|
|
return Advertisements::create($newData);
|
|
}
|
|
public function update($advertisementId, array $newDetails)
|
|
{
|
|
return Advertisements::where('advertisement_id', $advertisementId)->update($newDetails);
|
|
}
|
|
}
|