From 2edd3d5900a47fde3352bd0d9abb326cade293b8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 13 Feb 2013 01:33:58 +0000 Subject: [PATCH] Added 2 more methods --- .../interfaces/criteria/class_Criteria.php | 16 ++++++++++++++ .../main/criteria/class_BaseCriteria.php | 22 +++++++++++++++++++ 2 files changed, 38 insertions(+) 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 * -- 2.39.2