mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
34 lines
791 B
PHP
34 lines
791 B
PHP
<?php namespace Visiosoft\LocationModule\Country;
|
|
|
|
use Visiosoft\LocationModule\Country\Contract\CountryRepositoryInterface;
|
|
use Anomaly\Streams\Platform\Entry\EntryRepository;
|
|
|
|
class CountryRepository extends EntryRepository implements CountryRepositoryInterface
|
|
{
|
|
|
|
/**
|
|
* The entry model.
|
|
*
|
|
* @var CountryModel
|
|
*/
|
|
protected $model;
|
|
|
|
/**
|
|
* Create a new CountryRepository instance.
|
|
*
|
|
* @param CountryModel $model
|
|
*/
|
|
public function __construct(CountryModel $model)
|
|
{
|
|
$this->model = $model;
|
|
}
|
|
public function findById($id)
|
|
{
|
|
return $this->model->orderBy('created_at', 'DESC')->where('location_countries.id', $id)->first();
|
|
}
|
|
|
|
public function viewAll(){
|
|
return $this->model->get();
|
|
}
|
|
}
|