partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 96f40bb797fb36e8ad016d15a517e77853dec182
parent ba3012f849f0168c31e9b22cf475e064111e5010
Author: Felicitus <felicitus@felicitus.org>
Date:   Thu, 29 Dec 2011 07:33:53 +0100

Throw an exception if the specified call doesn't exist in the service

Diffstat:
Msrc/backend/de/RaumZeitLabor/PartKeepr/Service/ServiceManager.php | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/backend/de/RaumZeitLabor/PartKeepr/Service/ServiceManager.php b/src/backend/de/RaumZeitLabor/PartKeepr/Service/ServiceManager.php @@ -76,6 +76,9 @@ class ServiceManager { throw new ServiceException("Permission denied"); } + if (!method_exists($service, $call)) { + throw new \Exception(sprintf("The service %s doesn't implement %s", get_class($service), $call)); + } $result = $service->$call(); PartKeepr::getEM()->flush();