From: Roland Häder Date: Fri, 8 Feb 2013 17:25:04 +0000 (+0000) Subject: Added optional (here used) parameter X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=898cb55e60ac25fb70be69098e80d1ab61ffda34;p=hub.git Added optional (here used) parameter --- diff --git a/application/hub/interfaces/helper/nodes/class_NodeHelper.php b/application/hub/interfaces/helper/nodes/class_NodeHelper.php index eaf24ce94..1e1dd0a16 100644 --- a/application/hub/interfaces/helper/nodes/class_NodeHelper.php +++ b/application/hub/interfaces/helper/nodes/class_NodeHelper.php @@ -22,7 +22,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -interface NodeHelper extends Helper { +interface NodeHelper extends Helper, AddableCriteria { /** * Method to "bootstrap" the node. This step does also apply provided * command-line arguments stored in the request instance. You should now @@ -115,15 +115,6 @@ interface NodeHelper extends Helper { */ function getAddressPort (); - /** - * Adds hub data elements to a given dataset instance - * - * @param $criteriaInstance An instance of a storeable criteria - * @param $requestInstance An instance of a Requestable class - * @return void - */ - function addElementsToDataSet (StoreableCriteria $criteriaInstance, Requestable $requestInstance); - /** * Updates/refreshes node data (e.g. state). * diff --git a/application/hub/main/nodes/class_BaseHubNode.php b/application/hub/main/nodes/class_BaseHubNode.php index f5b854b27..cbccd5006 100644 --- a/application/hub/main/nodes/class_BaseHubNode.php +++ b/application/hub/main/nodes/class_BaseHubNode.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class BaseHubNode extends BaseHubSystem implements Updateable { +class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { /** * Node types */ @@ -397,7 +397,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable { * @param $requestInstance An instance of a Requestable class * @return void */ - public function addElementsToDataSet (StoreableCriteria $criteriaInstance, Requestable $requestInstance) { + public function addElementsToDataSet (StoreableCriteria $criteriaInstance, Requestable $requestInstance = NULL) { // Add node number and type $criteriaInstance->addCriteria(NodeInformationDatabaseWrapper::DB_COLUMN_NODE_NR, 1); $criteriaInstance->addCriteria(NodeInformationDatabaseWrapper::DB_COLUMN_NODE_TYPE, $requestInstance->getRequestElement('mode'));