Add a method to quickly check if a provider is assigned to a secretary.

This commit is contained in:
Alex Tselegidis 2023-04-15 14:34:42 +02:00
parent f540192570
commit c7a304c197

View file

@ -797,4 +797,19 @@ class Secretaries_model extends EA_Model {
$secretary = $decoded_resource;
}
/**
* Quickly check if a provider is assigned to a provider.
*
* @param int $secretary_id
* @param int $provider_id
*
* @return bool
*/
public function is_provider_supported(int $secretary_id, int $provider_id): bool
{
$secretary = $this->find($secretary_id);
return in_array($provider_id, $secretary['providers']);
}
}