X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fclasses%2Finterfaces%2Fcriteria%2Fclass_Criteria.php;h=9b49aebd5b2f5404ce3e4cdaf37fd5462ef770eb;hb=1ee35e6d96c456b8e3499bd683f1647aa28bd501;hp=86d9b36fd03ecb3179c4209d104f22dc7a735d16;hpb=29fdfbe1fcc8f3644360c02e36007b21c05513a4;p=core.git diff --git a/inc/classes/interfaces/criteria/class_Criteria.php b/inc/classes/interfaces/criteria/class_Criteria.php index 86d9b36f..9b49aebd 100644 --- a/inc/classes/interfaces/criteria/class_Criteria.php +++ b/inc/classes/interfaces/criteria/class_Criteria.php @@ -2,11 +2,11 @@ /** * An interface for criterias * - * @author Roland Haeder + * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 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 @@ -37,6 +37,31 @@ interface Criteria extends FrameworkInterface { */ function getWrapperConfigEntry (); + /** + * Checks whether given key is set + * + * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' + * @param $criteriaKey Criteria key + * @return $isSet Whether key is set + */ + function isKeySet ($criteriaType, $criteriaKey); + + /** + * Checks whether given key is set for 'choice' type + * + * @param $criteriaKey Criteria key + * @return $isSet Whether key is set + */ + function isChoiceKeySet ($criteriaKey); + + /** + * Checks whether given key is set for 'exclude' type + * + * @param $criteriaKey Criteria key + * @return $isSet Whether key is set + */ + function isExcludeKeySet ($criteriaKey); + /** * Getter for criteria array * @@ -59,6 +84,14 @@ interface Criteria extends FrameworkInterface { */ function getCriteriaExcludeArray (); + /** + * Unsets a criteria key from all criteria types + * + * @param $criteriaKey Criteria key to unset + * @return void + */ + function unsetCriteria ($criteriaKey); + /** * Add criteria, this method converts dashes to underscores because dashes * are not valid for criteria keys. @@ -101,14 +134,30 @@ interface Criteria extends FrameworkInterface { function addConfiguredCriteria ($criteriaKey, $configEntry, $criteriaType = 'default'); /** - * Get criteria element or null if not found + * Get criteria element or FALSE if not found * * @param $criteriaKey The requested criteria key * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' - * @return $value Whether the value of the critera or null + * @return $value Whether the value of the critera or FALSE */ function getCriteriaElemnent ($criteriaKey, $criteriaType = 'default'); + /** + * Get criteria element or FALSE if not found for 'choice' type + * + * @param $criteriaKey The requested criteria key + * @return $value Whether the value of the critera or FALSE + */ + function getCriteriaChoiceElemnent ($criteriaKey); + + /** + * Get criteria element or FALSE if not found for 'exclude' type + * + * @param $criteriaKey The requested criteria key + * @return $value Whether the value of the critera or FALSE + */ + function getCriteriaExcludeElemnent ($criteriaKey); + /** * Checks whether given array entry matches *