From: Roland Häder Date: Wed, 13 Feb 2013 01:33:58 +0000 (+0000) Subject: Added 2 more methods X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2edd3d5900a47fde3352bd0d9abb326cade293b8;p=core.git Added 2 more methods --- diff --git a/inc/classes/interfaces/criteria/class_Criteria.php b/inc/classes/interfaces/criteria/class_Criteria.php index 86d9b36f..737d5bc7 100644 --- a/inc/classes/interfaces/criteria/class_Criteria.php +++ b/inc/classes/interfaces/criteria/class_Criteria.php @@ -109,6 +109,22 @@ interface Criteria extends FrameworkInterface { */ function getCriteriaElemnent ($criteriaKey, $criteriaType = 'default'); + /** + * Get criteria element or null if not found for 'choice' type + * + * @param $criteriaKey The requested criteria key + * @return $value Whether the value of the critera or null + */ + function getCriteriaChoiceElemnent ($criteriaKey); + + /** + * Get criteria element or null if not found for 'exclude' type + * + * @param $criteriaKey The requested criteria key + * @return $value Whether the value of the critera or null + */ + function getCriteriaExcludeElemnent ($criteriaKey); + /** * Checks whether given array entry matches * diff --git a/inc/classes/main/criteria/class_BaseCriteria.php b/inc/classes/main/criteria/class_BaseCriteria.php index 6a451102..3b97b8b5 100644 --- a/inc/classes/main/criteria/class_BaseCriteria.php +++ b/inc/classes/main/criteria/class_BaseCriteria.php @@ -195,6 +195,28 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { return $value; } + /** + * Get criteria element or null if not found for 'choice' type + * + * @param $criteriaKey The requested criteria key + * @return $value Whether the value of the critera or null + */ + public function getCriteriaChoiceElemnent ($criteriaKey) { + // Call inner method + return $this->getCriteriaElemnent($criteriaKey, 'choice'); + } + + /** + * Get criteria element or null if not found for 'exclude' type + * + * @param $criteriaKey The requested criteria key + * @return $value Whether the value of the critera or null + */ + public function getCriteriaExcludeElemnent ($criteriaKey) { + // Call inner method + return $this->getCriteriaElemnent($criteriaKey, 'exclude'); + } + /** * Checks whether given array entry matches *