From: Roland Häder Date: Wed, 13 Feb 2013 01:25:11 +0000 (+0000) Subject: Added assert, all arrays are empty initialized now X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=28469f41b28046e5478a8e2e111de73536317753 Added assert, all arrays are empty initialized now --- diff --git a/inc/classes/main/criteria/class_BaseCriteria.php b/inc/classes/main/criteria/class_BaseCriteria.php index b1102e28..6a451102 100644 --- a/inc/classes/main/criteria/class_BaseCriteria.php +++ b/inc/classes/main/criteria/class_BaseCriteria.php @@ -30,7 +30,14 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { /** * Criteria to handle */ - private $criteria = array(); + private $criteria = array( + // Default + 'default' => array(), + // Choice + 'choice' => array(), + // .. and exclude + 'exclude' => array(), + ); /** * Protected constructor @@ -255,6 +262,12 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @return $cacheKey The key suitable for the cache system */ public function getCacheKey ($onlyKeys = array(), $criteriaType = 'default') { + // Debug message + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($this->__toString() . ': criteriaType=' . $criteriaType . ',count()=' . count($this->criteria)); + + // Make sure the criteria is there + assert((isset($this->criteria[$criteriaType])) && (is_array($this->criteria[$criteriaType]))); + // Initialize the key $cacheKey = '';