added a function to find the state by code and country code
This commit is contained in:
parent
b1b39d2c74
commit
69aeb2a254
|
|
@ -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
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue