X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=framework%2Fmain%2Finterfaces%2Fcriteria%2Fclass_Criteria.php;h=819b6825bf6e695f15a20e20b14ac4086368be4b;hb=HEAD;hp=30fb3ab5de9b1433bf274ac4a47c4cb681e8a190;hpb=adcdfc000eba8fac128786adcb8cb480085e7e76;p=core.git diff --git a/framework/main/interfaces/criteria/class_Criteria.php b/framework/main/interfaces/criteria/class_Criteria.php index 30fb3ab5..0ff16acb 100644 --- a/framework/main/interfaces/criteria/class_Criteria.php +++ b/framework/main/interfaces/criteria/class_Criteria.php @@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface; * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.shipsimu.org * @@ -28,20 +28,25 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface; * along with this program. If not, see . */ interface Criteria extends FrameworkInterface { + // Criteria types + const CRITERIA_TYPE_DEFAULT = 'default'; + const CRITERIA_TYPE_CHOICE = 'choice'; + const CRITERIA_TYPE_EXCLUDE = 'exclude'; + /** - * Setter for wrapper class name + * Setter for frontend class name * - * @param $wrapperConfigEntry Configuration entry which hold the wrapper class' name + * @param $frontendConfigEntry Configuration entry which hold the frontend class' name * @return void */ - function setWrapperConfigEntry ($wrapperConfigEntry); + function setFrontendConfigEntry (string $frontendConfigEntry); /** - * Getter for wrapper class name + * Getter for Frontend class name * - * @return $wrapperConfigEntry Configuration entry which hold the wrapper class' name + * @return $frontendConfigEntry Configuration entry which hold the Frontend class' name */ - function getWrapperConfigEntry (); + function getFrontendConfigEntry (); /** * Checks whether given key is set @@ -50,7 +55,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaKey Criteria key * @return $isSet Whether key is set */ - function isKeySet ($criteriaType, $criteriaKey); + function isKeySet (string $criteriaType, string $criteriaKey); /** * Checks whether given key is set for 'choice' type @@ -58,7 +63,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaKey Criteria key * @return $isSet Whether key is set */ - function isChoiceKeySet ($criteriaKey); + function isChoiceKeySet (string $criteriaKey); /** * Checks whether given key is set for 'exclude' type @@ -66,7 +71,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaKey Criteria key * @return $isSet Whether key is set */ - function isExcludeKeySet ($criteriaKey); + function isExcludeKeySet (string $criteriaKey); /** * Getter for criteria array @@ -74,7 +79,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return $criteria */ - function getCriteriaArray ($criteriaType = 'default'); + function getCriteriaArray (string $criteriaType = 'default'); /** * Getter for criteria array 'choice' type @@ -96,7 +101,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaKey Criteria key to unset * @return void */ - function unsetCriteria ($criteriaKey); + function unsetCriteria (string $criteriaKey); /** * Add criteria, this method converts dashes to underscores because dashes @@ -107,7 +112,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return void */ - function addCriteria ($criteriaKey, $criteriaValue, $criteriaType = 'default'); + function addCriteria (string $criteriaKey, $criteriaValue, string $criteriaType = 'default'); /** * Sets criteria, this method converts dashes to underscores because dashes @@ -118,7 +123,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return void */ - function setCriteria ($criteriaKey, $criteriaValue, $criteriaType = 'default'); + function setCriteria (string $criteriaKey, $criteriaValue, string $criteriaType = 'default'); /** * Add "choice" criteria, this method converts dashes to underscores because @@ -128,7 +133,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaValue Criteria value * @return void */ - function addChoiceCriteria ($criteriaKey, $criteriaValue); + function addChoiceCriteria (string $criteriaKey, $criteriaValue); /** * Add "exclude" criteria, this method converts dashes to underscores because @@ -138,7 +143,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaValue Criteria value * @return void */ - function addExcludeCriteria ($criteriaKey, $criteriaValue); + function addExcludeCriteria (string $criteriaKey, $criteriaValue); /** * Add configured criteria @@ -148,7 +153,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return void */ - function addConfiguredCriteria ($criteriaKey, $configEntry, $criteriaType = 'default'); + function addConfiguredCriteria (string $criteriaKey, string $configEntry, string $criteriaType = 'default'); /** * Get criteria element or false if not found @@ -157,7 +162,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return $value Whether the value of the critera or false */ - function getCriteriaElemnent ($criteriaKey, $criteriaType = 'default'); + function getCriteriaElemnent (string $criteriaKey, string $criteriaType = 'default'); /** * Get criteria element or false if not found for 'choice' type @@ -165,7 +170,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaKey The requested criteria key * @return $value Whether the value of the critera or false */ - function getCriteriaChoiceElemnent ($criteriaKey); + function getCriteriaChoiceElemnent (string $criteriaKey); /** * Get criteria element or false if not found for 'exclude' type @@ -173,7 +178,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaKey The requested criteria key * @return $value Whether the value of the critera or false */ - function getCriteriaExcludeElemnent ($criteriaKey); + function getCriteriaExcludeElemnent (string $criteriaKey); /** * Checks whether given array entry matches @@ -182,7 +187,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return $matches Whether the entry matches or not */ - function ifEntryMatches (array $entryArray, $criteriaType = 'default'); + function ifEntryMatches (array $entryArray, string $criteriaType = 'default'); /** * Checks whether given array 'choice' entry matches @@ -207,7 +212,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return $cacheKey The key suitable for the cache system */ - function getCacheKey ($onlyKeys = array(), $criteriaType = 'default'); + function getCacheKey (array $onlyKeys = [], string $criteriaType = 'default'); /** * "Getter" for a cache key ('choice' type) @@ -215,7 +220,7 @@ interface Criteria extends FrameworkInterface { * @param $onlyKeys Only use these keys for a cache key * @return $cacheKey The key suitable for the cache system */ - function getCacheKeyChoice ($onlyKeys = array()); + function getCacheKeyChoice (array $onlyKeys = []); /** * "Getter" for a cache key ('exclude' type) @@ -223,16 +228,7 @@ interface Criteria extends FrameworkInterface { * @param $onlyKeys Only use these keys for a cache key * @return $cacheKey The key suitable for the cache system */ - function getCacheKeyExclude ($onlyKeys = array()); - - /** - * Count the criteria, e.g. useful to find out if a database query has no - * limitation (search criteria). - * - * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' - * @return $count Count of all criteria entries - */ - function count ($criteriaType = 'default'); + function getCacheKeyExclude (array $onlyKeys = []); /** * Count 'choice' criteria, e.g. useful to find out if a database query