mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-30 20:02:52 +03:00
Add helper methods to quickly check if a service is assigned to a provider
This commit is contained in:
parent
6fc45c3368
commit
f540192570
1 changed files with 15 additions and 0 deletions
|
@ -1012,4 +1012,19 @@ class Providers_model extends EA_Model {
|
||||||
|
|
||||||
$provider = $decoded_resource;
|
$provider = $decoded_resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Quickly check if a service is assigned to a provider.
|
||||||
|
*
|
||||||
|
* @param int $provider_id
|
||||||
|
* @param int $service_id
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function is_service_supported(int $provider_id, int $service_id): bool
|
||||||
|
{
|
||||||
|
$provider = $this->find($provider_id);
|
||||||
|
|
||||||
|
return in_array($service_id, $provider['services']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue