]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/lists/class_BaseList.php
Rewritten:
[core.git] / framework / main / classes / lists / class_BaseList.php
index e629b17771c63c7f6410728febaeb044aadbec51..965c9b825f2c37e9edf06f5425f4ca2e50ed6900 100644 (file)
@@ -40,11 +40,6 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab
        const EXCEPTION_GROUP_NOT_FOUND     = 0xf21;
        const EXCEPTION_INVALID_HASH        = 0xf22;
 
-       /**
-        * Call-back instance
-        */
-       private $callbackInstance = NULL;
-
        /**
         * List groups array
         */
@@ -71,16 +66,6 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab
                parent::__construct($className);
        }
 
-       /**
-        * Setter for call-back instance
-        *
-        * @param       $callbackInstance       An instance of a FrameworkInterface class
-        * @return      void
-        */
-       public final function setCallbackInstance (FrameworkInterface $callbackInstance) {
-               $this->callbackInstance = $callbackInstance;
-       }
-
        /**
         * Getter for iterator instance from this list
         *
@@ -163,11 +148,7 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab
                $hash = $this->generateHash($groupName, $subGroup, $visitableInstance);
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName  . ',subGroup=' . $subGroup . ',hash=' . $hash . ' - Calling addEntry() ...');
-
-               // Now add it to the group list and hash it
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',this->listGroups[' . $groupName . ']=' . $this->listGroups[$groupName]->__toString());
-               //$this->listGroups[$groupName]->addEntry($subGroup, $hash);
 
                // Add the hash to the index
                array_push($this->listIndex, $hash);
@@ -323,12 +304,12 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab
                } elseif ((is_array($entry)) && (isset($entry['id']))) {
                        // Supported array found
                        $entry2 = crc32($entry['id']) . ':' . count($entry);
-               } elseif (($this->callbackInstance instanceof FrameworkInterface) && (method_exists(array($this->callbackInstance, 'generateListHashFromEntry')))) {
+               } elseif (($this->getCallbackInstance() instanceof FrameworkInterface) && (method_exists($this->getCallbackInstance(), 'generateListHashFromEntry'))) {
                        // Call it instead
-                       $entry2 = $this->callbackInstance->generateListHashFromEntry($entry);
+                       $entry2 = $this->getCallbackInstance()->generateListHashFromEntry($entry);
                } else {
                        // Unsupported type detected
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-LIST[' . __METHOD__ . ':' . __LINE__ . ']: Entry type ' . gettype($entry) . ' is unsupported.');
+                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-LIST[' . __METHOD__ . ':' . __LINE__ . ']: Entry type ' . gettype($entry) . ' is unsupported (this->callbackInstance=' . $this->getCallbackInstance() . ').');
 
                        // At least take all keys from array
                        $entry2 = gettype($entry) . ':' . implode(':', array_keys($entry));