protected function getCountersRecursive($objFields, $objCollection = null)
    {
        if (is_null($objCollection)) {
            $objCollection = new Collection();
        }

        foreach ($objFields as $objField) {
            if ($objField instanceof Element && $objField->isDynamicCounter()) {
                $objCollection->addObject($objField);
            }

            if ($objField->hasFields()) {
                $this->getCountersRecursive($objField->getFields(), $objCollection);
            }
        }

        return $objCollection;
    }
protected function getCountersRecursive($objFields, $objCollection = null)
    {
        if (is_null($objCollection)) {
            $objCollection = new Collection();
        }

        foreach ($objFields as $objField) {
            if ($objField instanceof Element && $objField->isDynamicCounter()) {
                $objCollection->addObject($objField);
            }

            if ($objField->hasFields()) {
                $this->getCountersRecursive($objField->getFields(), $objCollection);
            }
        }

        return $objCollection;
    }
protected function getCountersRecursive ( $ objFields , $ objCollection = null ) { if ( is_null ( $ objCollection ) ) { $ objCollection = new Collection ( ) ; } foreach ( $ objFields as $ objField ) { if ( $ objField instanceof Element && $ objField -> isDynamicCounter ( ) ) { $ objCollection -> addObject ( $ objField ) ; } if ( $ objField -> hasFields ( ) ) { $ this -> getCountersRecursive ( $ objField -> getFields ( ) , $ objCollection ) ; } } return $ objCollection ; }
Get a collection of fields and look for dynamic counters recursively
@param Collection $objFields
@param Collection $objCollection
@return Collection
Get a collection of fields and look for dynamic counters recursively