3 namespace Org\Mxchange\CoreFramework\Result\Database;
5 // Import framework stuff
6 use Org\Mxchange\CoreFramework\Criteria\Local\LocalSearchCriteria;
7 use Org\Mxchange\CoreFramework\Criteria\Local\LocalUpdateCriteria;
8 use Org\Mxchange\CoreFramework\Criteria\Storing\StoreableCriteria;
9 use Org\Mxchange\CoreFramework\Database\Frontend\DatabaseFrontend;
10 use Org\Mxchange\CoreFramework\Database\Backend\BaseDatabaseBackend;
11 use Org\Mxchange\CoreFramework\Result\Database\BaseDatabaseResult;
12 use Org\Mxchange\CoreFramework\Result\Search\SearchableResult;
13 use Org\Mxchange\CoreFramework\Result\Update\UpdateableResult;
16 use \InvalidArgumentException;
17 use \OutOfBoundsException;
18 use \SeekableIterator;
21 * A database result class
23 * @author Roland Haeder <webmaster@shipsimu.org>
25 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
26 * @license GNU GPL 3.0 or any newer version
27 * @link http://www.shipsimu.org
29 * This program is free software: you can redistribute it and/or modify
30 * it under the terms of the GNU General Public License as published by
31 * the Free Software Foundation, either version 3 of the License, or
32 * (at your option) any later version.
34 * This program is distributed in the hope that it will be useful,
35 * but WITHOUT ANY WARRANTY; without even the implied warranty of
36 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37 * GNU General Public License for more details.
39 * You should have received a copy of the GNU General Public License
40 * along with this program. If not, see <http://www.gnu.org/licenses/>.
42 class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResult, UpdateableResult, SeekableIterator {
43 // Exception constants
44 const EXCEPTION_INVALID_DATABASE_RESULT = 0x1c0;
45 const EXCEPTION_RESULT_UPDATE_FAILED = 0x1c1;
48 * Current position in array
50 private $currentPos = -1;
55 private $currentRow = NULL;
60 private $resultArray = [];
63 * Array of out-dated entries
65 private $outDated = [];
70 private $affectedRows = 0;
75 private $foundValue = '';
78 * Protected constructor
82 private function __construct () {
83 // Call parent constructor
84 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: CONSTRUCTED!');
85 parent::__construct(__CLASS__);
88 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: EXIT!');
92 * Creates an instance of this result by a provided result array
94 * @param $resultArray The array holding the result from query
95 * @return $resultInstance An instance of this class
96 * @throws InvalidArgumentException If a parameter is invalid
98 public static final function createCachedDatabaseResult (array $resultArray) {
100 //* DEBUG-DIE: */ die(sprintf('[%s:%d]: resultArray=%s', __METHOD__, __LINE__, print_r($resultArray, true)));
101 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: resultArray()=%d - CALLED!', count($resultArray)));
102 if (count($resultArray) == 0) {
104 throw new InvalidArgumentException('Array "resultArray" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
105 } elseif (!array_key_exists(BaseDatabaseResult::RESULT_NAME_ROWS, $resultArray)) {
106 // Yes, then abort here
107 throw new InvalidArgumentException(sprintf('resultArray(%d)=%s has no element "%s".', count($resultArray), print_r($resultArray, TRUE), BaseDatabaseResult::RESULT_NAME_ROWS));
108 } elseif (!array_key_exists(BaseDatabaseResult::RESULT_NAME_STATUS, $resultArray)) {
109 // Yes, then abort here
110 throw new InvalidArgumentException(sprintf('resultArray(%d)=%s has no element "%s".', count($resultArray), print_r($resultArray, TRUE), BaseDatabaseResult::RESULT_NAME_STATUS));
113 // Get a new instance
114 $resultInstance = new CachedDatabaseResult();
116 // Set the result array
117 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: Setting resultArray()=%d ...', count($resultArray)));
118 $resultInstance->setResultArray($resultArray);
120 // Reset current position
121 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: Invoking resultInstance->resetCurrentPosition() ...');
122 $resultInstance->resetCurrentPosition();
125 $resultInstance->setAffectedRows(count($resultArray[BaseDatabaseResult::RESULT_NAME_ROWS]));
127 // Return the instance
128 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: resultInstance=%s - EXIT!', $resultInstance->__toString()));
129 return $resultInstance;
133 * Setter for result array
135 * @param $resultArray The array holding the result from query
138 protected final function setResultArray (array $resultArray) {
139 $this->resultArray = $resultArray;
143 * Updates the current entry by given update criteria
145 * @param $updateInstance An instance of an Updateable criteria
148 private function updateCurrentEntryByCriteria (LocalUpdateCriteria $updateInstance) {
149 // Get the current entry key
150 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: updateInstance=%s - CALLED!', $updateInstance->__toString()));
151 $entryKey = $this->key();
153 // Now get the update criteria array and update all entries
154 foreach ($updateInstance->getUpdateCriteria() as $criteriaKey => $criteriaValue) {
156 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: criteriaKey=%s,criteriaValue[%s]=%s', $criteriaKey, gettype($criteriaValue), $criteriaValue));
157 $this->resultArray[BaseDatabaseResult::RESULT_NAME_ROWS][$entryKey][$criteriaKey] = $criteriaValue;
159 // Mark it as out-dated
160 $this->outDated[$criteriaKey] = 1;
164 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: EXIT!');
168 * "Iterator" method next() to advance to the next valid entry. This method
169 * does also check if result is invalid
171 * @return $nextValid Whether the next entry is valid
173 public function next () {
174 // Default is not valid
175 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: CALLED!');
181 // Is the result valid?
182 if ($this->valid()) {
183 // Next entry found, so cache it
184 $this->currentRow = $this->resultArray[BaseDatabaseResult::RESULT_NAME_ROWS][$this->currentPos];
189 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: nextValid=%d - EXIT!', intval($nextValid)));
194 * Seeks for to a specified position
196 * @param $seekPosition Position to seek to
198 * @throws OutOfBoundsException If the position is not seekable
200 public function seek (int $seekPosition) {
201 // Validate parameter
202 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: seekPosition=%d - CALLED!', $seekPosition));
203 if ($seekPosition < 0) {
205 throw new OutOfBoundsException(sprintf('seekPositon=%d is not seekable', $seekPosition));
208 // Rewind to beginning
211 // Search for the entry
212 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: this->currentPos=%d,seekPosition=%d', $this->currentPos, $seekPosition));
213 while (($this->currentPos < $seekPosition) && ($this->valid())) {
219 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: EXIT!');
223 * Gives back the current position or null if not found
225 * @return $current Current element to give back
227 public function current () {
228 // Default is not found
229 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: CALLED!');
232 // Does the current enty exist?
233 if (isset($this->resultArray[BaseDatabaseResult::RESULT_NAME_ROWS][$this->currentPos])) {
235 $current = $this->resultArray[BaseDatabaseResult::RESULT_NAME_ROWS][$this->currentPos];
239 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: current[]=%s - EXIT!', gettype($current)));
244 * Checks if next() and rewind will give a valid result
246 * @return $isValid Whether the next/rewind entry is valid
248 public function valid () {
249 // Check if all is fine ...
250 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: this->currentPos=%d - CALLED!', $this->currentPos));
251 $isValid = ($this->ifStatusIsOkay() && isset($this->resultArray[BaseDatabaseResult::RESULT_NAME_ROWS][$this->currentPos]) && isset($this->resultArray[BaseDatabaseResult::RESULT_NAME_ROWS][0]));
254 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: isValid=%d - EXIT!', intval($isValid)));
259 * Returns count of entries
261 * @return $isValid Whether the next/rewind entry is valid
263 public function count () {
265 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: CALLED!');
266 $count = count($this->resultArray[BaseDatabaseResult::RESULT_NAME_ROWS]);
269 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: count=%d - EXIT!', $count));
274 * Determines whether the status of the query was fine (BaseDatabaseBackend::RESULT_OKAY)
276 * @return $ifStatusOkay Whether the status of the query was okay
278 public function ifStatusIsOkay () {
279 // Check all conditions
280 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: this->currentPos=%d - CALLED!', $this->currentPos));
281 $ifStatusOkay = (isset($this->resultArray[BaseDatabaseResult::RESULT_NAME_STATUS]) && $this->resultArray[BaseDatabaseResult::RESULT_NAME_STATUS] === BaseDatabaseBackend::RESULT_OKAY);
284 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: ifStatusOkay=%s - EXIT!', intval($ifStatusOkay)));
285 return $ifStatusOkay;
289 * Gets the current key of iteration
291 * @return $currentPos Key from iterator
293 public function key () {
294 // Return current array position
295 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: this->currentPos=%d - CALLED!', $this->currentPos));
296 return $this->currentPos;
300 * Rewind to the beginning and clear array $currentRow
304 public function rewind () {
305 // Reset both current array position and current row
306 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: this->currentPos=%d - CALLED!', $this->currentPos));
307 $this->resetCurrentPosition();
308 $this->currentRow = [];
311 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: EXIT!');
315 * Resets current array position to 0 if at least one record is there or -1
316 * if no record is there.
320 private function resetCurrentPosition () {
322 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: CALLED!');
323 $this->currentPos = ($this->count() > 0 ? 0 : -1);
326 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: this->currentPos=%d - EXIT!', $this->currentPos));
330 * Searches for an entry in data result and returns it
332 * @param $criteriaInstance The criteria to look inside the data set
333 * @return $result Found result entry
336 public function searchEntry (LocalSearchCriteria $criteriaInstance) {
338 $this->debugBackTrace(sprintf('[%s:%d]: criteriaInstance=%s', __METHOD__, __LINE__, print_r($criteriaInstance, TRUE)));
342 * Adds an update request to the database result for writing it to the
345 * @param $updateInstance An instance of a updateable criteria
347 * @throws ResultUpdateException If no result was updated
349 public function add2UpdateQueue (LocalUpdateCriteria $updateInstance) {
350 // Rewind the pointer
351 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: updateInstance=%s - CALLED!', $updateInstance->__toString()));
354 // Get search criteria
355 $searchInstance = $updateInstance->getSearchInstance();
358 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: searchInstance=%s', $searchInstance->__toString()));
359 $foundEntries = $this->getAffectedRows();
361 // And start looking for the result
362 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: foundEntries=%d,searchInstance->limit=%d', $foundEntries, $searchInstance->getLimit()));
363 while (($this->valid()) && ($foundEntries < $searchInstance->getLimit())) {
365 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: Invoking this->next() ...');
369 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: Invoking this->current() ...');
370 $currentEntry = $this->current();
372 // Is this entry found?
373 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: currentEntry[]=%s - EXIT!', gettype($currentEntry)));
374 if ($searchInstance->ifEntryMatches($currentEntry)) {
376 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: Invoking this->updateCurrentEntryByCriteria(%s) ...', $updateInstance->__toString()));
377 $this->updateCurrentEntryByCriteria($updateInstance);
381 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: foundEntries=%d', $foundEntries));
385 // If no entry is found/updated throw an exception
386 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: foundEntries=%d', $foundEntries));
387 if ($foundEntries == 0) {
388 // Throw an exception here
389 throw new ResultUpdateException($this, self::EXCEPTION_RESULT_UPDATE_FAILED);
393 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: Invoking this->setAffectedRows(%d) ...', $foundEntries));
394 $this->setAffectedRows($foundEntries);
396 // Set update instance
397 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: Invoking this->setUpdateInstance(%s) ...', $updateInstance->__toString()));
398 $this->setUpdateInstance($updateInstance);
401 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: EXIT!');
405 * Setter for affected rows
407 * @param $rows Number of affected rows
410 public final function setAffectedRows (int $rows) {
411 $this->affectedRows = $rows;
415 * Getter for affected rows
417 * @return $rows Number of affected rows
419 public final function getAffectedRows () {
420 return $this->affectedRows;
424 * Getter for found value of previous found() call
426 * @return $foundValue Found value of previous found() call
428 public final function getFoundValue () {
429 return $this->foundValue;
433 * Checks whether we have out-dated entries or not
435 * @return $needsUpdate Whether we have out-dated entries
437 public function ifDataNeedsFlush () {
438 // Check if records are out-dated
439 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: CALLED!');
440 $needsUpdate = (count($this->outDated) > 0);
443 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: needsUpdate=%d - EXIT!', intval($needsUpdate)));
448 * Adds registration elements to a given dataset instance
450 * @param $criteriaInstance An instance of a StoreableCriteria class
453 public function addElementsToDataSet (StoreableCriteria $criteriaInstance) {
454 // Walk only through out-dated columns
455 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: criteriaInstance=%s - CALLED!', $criteriaInstance->__toString()));
456 foreach ($this->outDated as $key => $dummy) {
457 // Does this key exist?
458 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: key=%s,dummy[]=%s', $key, gettype($dummy)));
459 if ($this->find($key)) {
461 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: Invoking criteriaInstance->addCriteria(%s,foundValue[]=%s) ...', $key, gettype($this->getFoundValue())));
462 $criteriaInstance->addCriteria($key, $this->getFoundValue());
467 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: EXIT!');
471 * Find a key inside the result array
473 * @param $key The key we shall find
474 * @return $found Whether the key was found or not
475 * @throws InvalidArgumentException If a parameter is invalid
477 public function find (string $key) {
479 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: key=%s - CALLED!', $key));
482 throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
485 // By default nothing is found
488 // Rewind the pointer
489 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: Invoking this->rewind() ...');
492 // Walk through all entries
493 while ($this->valid()) {
494 // Advance to next entry
495 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: Invoking this->next() ...');
498 // Get the whole array
499 $currentEntry = $this->current();
501 // Is the element there?
502 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: currentEntry[]=%s - EXIT!', gettype($currentEntry)));
503 if (isset($currentEntry[$key])) {
505 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: key=%s is found in currentEntry', $key));
509 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: Setting this->foundValue to currentEntry[%s][]=%s is found in currentEntry', $key, gettype($currentEntry[$key])));
510 $this->foundValue = $currentEntry[$key];
512 // And stop searching
513 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('CACHED-DATABASE-RESULT: BREAK!');
519 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: found=%d - EXIT!', intval($found)));
524 * Solver for result index value with call-back method
526 * @param $databaseColumn Database column where the index might be found
527 * @param $frontendInstance The frontend instance to ask for array element
528 * @para $callback Call-back object for setting the index;
529 * 0=object instance,1=method name
531 * @throws InvalidArgumentException If a parameter is invalid
532 * @todo Find a caching way without modifying the result array
534 public function solveResultIndex (string $databaseColumn, DatabaseFrontend $frontendInstance, array $callback) {
536 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: databaseColumn=%s,frontendInstance=%s,callback()=%d - CALLED!', $databaseColumn, $frontendInstance->__toString(), count($callback)));
539 throw new InvalidArgumentException('Parameter "key" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
540 } elseif (count($callback) != 2) {
542 throw new InvalidArgumentException(sprintf('callback()=%d must be exactly 2', count($callback)), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
543 } elseif (!is_callable($callback)) {
545 throw new InvalidArgumentException(sprintf('%s:%s() is not callable', $callback[0], $callback[1]), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
548 // By default nothing is found
551 // Is the element in result itself found?
552 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: Invoking this->find(%s),frontendInstance->indexKey=%s ...', $databaseColumn, $frontendInstance->getIndexKey()));
553 if ($this->find($databaseColumn)) {
555 $indexValue = $this->getFoundValue();
556 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: indexValue[]=%s from this->find(%s) - databaseColumn', gettype($indexValue), $databaseColumn));
557 } elseif ($this->find($frontendInstance->getIndexKey())) {
559 $indexValue = $this->getFoundValue();
560 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('CACHED-DATABASE-RESULT: indexValue[]=%s from this->find(%s) - frontendInstance->indexKey', gettype($indexValue), $frontendInstance->getIndexKey()));
564 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('CACHED-DATABASE-RESULT: Invoking %s:%s(indexValue[]=%s) ...', $callback[0], $callback[1], gettype($indexValue)));
565 call_user_func_array($callback, [$indexValue]);
568 //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('CACHED-DATABASE-RESULT: EXIT!');