for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Oc\Country;
/**
* Class CountryService
*
* @package Oc\Country
* @author Nick Lubisch <[email protected]>
*/
class CountryService
{
* @var CountryRepository
private $countryRepository;
* CountryService constructor.
* @param CountryRepository $countryRepository
public function __construct(CountryRepository $countryRepository)
$this->countryRepository = $countryRepository;
}
* Fetches all countries.
* @return CountryEntity[]
public function fetchAll()
return $this->countryRepository->fetchAll();
* Creates a country in the database.
* @param CountryEntity $entity
* @return CountryEntity
public function create(CountryEntity $entity)
return $this->countryRepository->create($entity);
* Update a country in the database.
public function update(CountryEntity $entity)
return $this->countryRepository->update($entity);
* Removes a country from the database.
public function remove(CountryEntity $entity)
return $this->countryRepository->remove($entity);