This getter needs also to be public and be called through iterator.
[core.git] / inc / classes / main / stacker / file / class_BaseFileStack.php
index 6379821f7aed5da14cea8c8d95446437fda02c97..6b50a6e0d934b81b3c0d434972dcdfa5c00d3452 100644 (file)
@@ -120,7 +120,7 @@ class BaseFileStack extends BaseStacker {
                        chr(BaseFile::SEPARATOR_HEADER_DATA),
 
                        // Total entries (will be zero) and pad it to 20 chars
-                       str_pad($this->dec2hex($this->getCounter()), BaseFile::LENGTH_COUNT, '0', STR_PAD_LEFT),
+                       str_pad($this->dec2hex($this->getIteratorInstance()->getCounter()), BaseFile::LENGTH_COUNT, '0', STR_PAD_LEFT),
 
                        // Separator count<->seek position
                        chr(BaseFile::SEPARATOR_HEADER_DATA),
@@ -400,7 +400,7 @@ class BaseFileStack extends BaseStacker {
         */
        public function getStackCount ($stackerName) {
                // Now, simply return the found count value, this must be up-to-date then!
-               return $this->getCounter();
+               return $this->getIteratorInstance()->getCounter();
        }
 
        /**
@@ -480,6 +480,17 @@ class BaseFileStack extends BaseStacker {
        public function updateSeekPosition () {
                throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
+
+       /**
+        * Getter for total entries
+        *
+        * @return      $totalEntries   Total entries in this file
+        * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
+        */
+       public final function getCounter () {
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
+       }
+
 }
 
 // [EOF]