Skip to content

Commit

Permalink
Add a method to quickly check if a provider is assigned to a secretary.
Browse files Browse the repository at this point in the history
  • Loading branch information
alextselegidis committed Apr 15, 2023
1 parent f540192 commit c7a304c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions application/models/Secretaries_model.php
Expand Up @@ -797,4 +797,19 @@ public function api_decode(array &$secretary, array $base = NULL)

$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']);
}
}

0 comments on commit c7a304c

Please sign in to comment.