X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fclasses%2Fmain%2Fdiscovery%2Fpayment%2Fclass_LocalPaymentDiscovery.php;h=95554231c65a98aebb425ad2dd2bef96d566de09;hb=1ee35e6d96c456b8e3499bd683f1647aa28bd501;hp=b9537431dd1767ff07d374c9aeed118c2ede4e72;hpb=0cd57c3885f00ad77fc599e53ed2f2d5e7ac267f;p=core.git diff --git a/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php b/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php index b9537431..95554231 100644 --- a/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php +++ b/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php @@ -4,11 +4,11 @@ * registered payment types and like all the others it at least returns the * money bank transfer type. * - * @author Roland Haeder + * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org + * @link http://www.shipsimu.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,10 +32,6 @@ class LocalPaymentDiscovery extends BaseDiscovery implements Discoverable, Regis protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** @@ -44,7 +40,7 @@ class LocalPaymentDiscovery extends BaseDiscovery implements Discoverable, Regis * @param $filterInstance An instance of a filter * @return $discoveryInstance An instance of this discovery class */ - public final static function createLocalPaymentDiscovery (Filterable $filterInstance) { + public static final function createLocalPaymentDiscovery (Filterable $filterInstance) { // Get an instance of this class $discoveryInstance = new LocalPaymentDiscovery(); @@ -64,8 +60,8 @@ class LocalPaymentDiscovery extends BaseDiscovery implements Discoverable, Regis public function discover (Requestable $requestInstance) { // Now get a search criteria and set app name and payment action as search critera $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); - $criteriaInstance->addCriteria("app_name", $requestInstance->getRequestElement('app')); - $criteriaInstance->addCriteria("payment_action", $this->getActionName().'_action'); + $criteriaInstance->addCriteria('app_name', $requestInstance->getRequestElement('app')); + $criteriaInstance->addCriteria('payment_action', $this->getActionName() . '_action'); $criteriaInstance->setLimit(1); // Get a wrapper instance @@ -74,6 +70,9 @@ class LocalPaymentDiscovery extends BaseDiscovery implements Discoverable, Regis // Get result back $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance); + // Advanced to next entry and assert on it as it should always be there + assert($resultInstance->valid()); + // Set the result instance $this->setResultInstance($resultInstance); }