added a function to find the state by code and country code

This commit is contained in:
Prashant Singh 2019-02-07 13:58:14 +05:30
parent b1b39d2c74
commit 69aeb2a254
1 changed files with 18 additions and 0 deletions

View File

@ -591,6 +591,24 @@ class Core
return $collection; return $collection;
} }
/**
* Retrieve all grouped states by country code
*
* @return Collection
*/
public function findStateByCountryCode($countryCode = null, $stateCode = null)
{
$collection = array();
$collection = $this->countryStateRepository->findByField(['country_code' => $countryCode, 'code' => $stateCode]);
if(count($collection)) {
return $collection->first();
} else {
return false;
}
}
/** /**
* Returns time intervals * Returns time intervals
* *