/**
* Does the specified offset exist in cache?
*
- * @param $offset The offset we are looking for
- * @return $exists Whether the offset exists
+ * @param $offset The offset we are looking for
+ * @param $arrayElement If type is array, then this element must be found
+ * @param $minimumCount If array element is found then this count must at least match
+ * @return $exists Whether the offset exists
*/
- public function offsetExists ($offset) {
+ public function offsetExists ($offset, $arrayElement = NULL, $minimumCount = 0) {
+ // Is it there?
$exists = $this->dataCache->offsetExists($offset);
+
+ // So look for array element?
+ if (($exists === TRUE) && (!is_null($arrayElement))) {
+ // Get it
+ $array = $this->offetget($offset);
+
+ // Is it an array and element is found?
+ if ((is_array($array)) && (isset($array[$arrayElement]))) {
+ // Is an array and element is found, so check count
+ $exists = (count($array[$arrayElement]) >= $minimumCount);
+ } else {
+ // Not found
+ $exists = FALSE;
+ }
+ } // END - if
+
+ // Return status
return $exists;
}