From a2fcd264491e3b55453b326ea522133d26293187 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 8 Feb 2013 17:19:55 +0000 Subject: [PATCH] Added interface AddableCriteria --- .gitattributes | 1 + .../extended/class_AddableCriteria.php | 70 +++++++++++++++++++ .../points/class_BookablePoints.php | 10 +-- .../registration/class_UserRegister.php | 10 +-- .../result/class_UpdateableResult.php | 10 +-- 5 files changed, 74 insertions(+), 27 deletions(-) create mode 100644 inc/classes/interfaces/criteria/extended/class_AddableCriteria.php diff --git a/.gitattributes b/.gitattributes index 2075b2fe..1da6d331 100644 --- a/.gitattributes +++ b/.gitattributes @@ -148,6 +148,7 @@ inc/classes/interfaces/controller/class_Controller.php svneol=native#text/plain inc/classes/interfaces/criteria/.htaccess svneol=native#text/plain inc/classes/interfaces/criteria/class_Criteria.php svneol=native#text/plain inc/classes/interfaces/criteria/extended/.htaccess svneol=native#text/plain +inc/classes/interfaces/criteria/extended/class_AddableCriteria.php -text inc/classes/interfaces/criteria/extended/class_LocalSearchCriteria.php svneol=native#text/plain inc/classes/interfaces/criteria/extended/class_LocalUpdateCriteria.php svneol=native#text/plain inc/classes/interfaces/criteria/extended/class_StoreableCriteria.php svneol=native#text/plain diff --git a/inc/classes/interfaces/criteria/extended/class_AddableCriteria.php b/inc/classes/interfaces/criteria/extended/class_AddableCriteria.php new file mode 100644 index 00000000..fd6e6853 --- /dev/null +++ b/inc/classes/interfaces/criteria/extended/class_AddableCriteria.php @@ -0,0 +1,70 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +interface Addable extends FrameworkInterface { + /** + * Adds registration elements to a given dataset instance + * + * @param $criteriaInstance An instance of a storeable criteria + * @return void + */ + function addElementsToDataSet (StoreableCriteria $criteriaInstance); +} + +// [EOF] +?> + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +interface Addable extends FrameworkInterface { + /** + * Adds registration elements to a given dataset instance + * + * @param $criteriaInstance An instance of a storeable criteria + * @return void + */ + function addElementsToDataSet (StoreableCriteria $criteriaInstance); +} + +// [EOF] +?> diff --git a/inc/classes/interfaces/points/class_BookablePoints.php b/inc/classes/interfaces/points/class_BookablePoints.php index b67f2769..a1de2215 100644 --- a/inc/classes/interfaces/points/class_BookablePoints.php +++ b/inc/classes/interfaces/points/class_BookablePoints.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -interface BookablePoints extends FrameworkInterface { +interface BookablePoints extends AddableCriteria { /** * Checks whether the user has the required amount of points left for the specified action * @@ -37,14 +37,6 @@ interface BookablePoints extends FrameworkInterface { * @return void */ function bookPointsDirectly ($amount); - - /** - * Adds registration elements to a given dataset instance - * - * @param $criteriaInstance An instance of a storeable criteria - * @return void - */ - function addElementsToDataSet (StoreableCriteria $criteriaInstance); } // [EOF] diff --git a/inc/classes/interfaces/registration/class_UserRegister.php b/inc/classes/interfaces/registration/class_UserRegister.php index faa409eb..bae7b61e 100644 --- a/inc/classes/interfaces/registration/class_UserRegister.php +++ b/inc/classes/interfaces/registration/class_UserRegister.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -interface UserRegister extends FrameworkInterface { +interface UserRegister extends AddableCriteria { /** * Encrypt given request key or throws an exception if key was not found in * request. @@ -62,14 +62,6 @@ interface UserRegister extends FrameworkInterface { * @return void */ function doPostAction (); - - /** - * Adds registration elements to a given dataset instance - * - * @param $criteriaInstance An instance of a storeable criteria - * @return void - */ - function addElementsToDataSet (StoreableCriteria $criteriaInstance); } // [EOF] diff --git a/inc/classes/interfaces/result/class_UpdateableResult.php b/inc/classes/interfaces/result/class_UpdateableResult.php index f541dc35..897a1e1d 100644 --- a/inc/classes/interfaces/result/class_UpdateableResult.php +++ b/inc/classes/interfaces/result/class_UpdateableResult.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -interface UpdateableResult extends FrameworkInterface { +interface UpdateableResult extends AddableCriteria { /** * Adds an update request to the database result for writing it to the * database layer @@ -31,14 +31,6 @@ interface UpdateableResult extends FrameworkInterface { * @throws ResultUpdateException If no result was updated */ function add2UpdateQueue (LocalUpdateCriteria $criteriaInstance); - - /** - * Adds registration elements to a given dataset instance - * - * @param $criteriaInstance An instance of a storeable criteria - * @return void - */ - function addElementsToDataSet (StoreableCriteria $criteriaInstance); } // [EOF] -- 2.30.2