public function load()
    {
        if ($this->_isCollectionLoaded == false) {


            $collection = Mage::getResourceModel('catalog/category_collection')->addNameToResult();
            /* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection */

            foreach ($collection as $category) {
                /** @var $category Mage_Catalog_Model_Category */
                $structure = explode('/', $category->getPath());
                $pathSize = count($structure);
                if ($pathSize > 1) {
                    $path = array();
                    for ($i = 1; $i < $pathSize; $i++) {
                        $path[] = $collection->getItemById($structure[$i])->getName();
                    }
                    $rootCategoryName = array_shift($path);
                    if (!isset($this->_categoriesWithRoots[$rootCategoryName])) {
                        $this->_categoriesWithRoots[$rootCategoryName] = array();
                    }
                    $index = $this->_implodeEscaped('/', $path);

                    $this->_categoriesWithRoots[$rootCategoryName][$index] = array(
                        'entity_id' => $category->getId(),
                        'path' => $category->getPath(),
                        'level' => $category->getLevel(),
                        'position' => $category->getPosition()
                    );

//allow importing by ids.
                    if (!isset($this->_categoriesWithRoots[$structure[1]])) {
                        $this->_categoriesWithRoots[$structure[1]] = array();
                    }
                    $this->_categoriesWithRoots[$structure[1]][$category->getId()] =
                        $this->_categoriesWithRoots[$rootCategoryName][$index];
                }
            }


            $collection = clone $this->_categoryCollection;
            $collection->removeAttributeToSelect();
            $tableName = $collection->getResource()->getEntityTable();
            $collection->getSelect()->from($tableName, ['entity_id', 'website_id', 'email']);

            $this->_byPagesIterator->iterate(
                $this->_categoryCollection,
                $this->_pageSize,
                [[$this, 'addCustomer']]
            );

            $this->_isCollectionLoaded = true;
        }
    }
public function load()
    {
        if ($this->_isCollectionLoaded == false) {


            $collection = Mage::getResourceModel('catalog/category_collection')->addNameToResult();
            /* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection */

            foreach ($collection as $category) {
                /** @var $category Mage_Catalog_Model_Category */
                $structure = explode('/', $category->getPath());
                $pathSize = count($structure);
                if ($pathSize > 1) {
                    $path = array();
                    for ($i = 1; $i < $pathSize; $i++) {
                        $path[] = $collection->getItemById($structure[$i])->getName();
                    }
                    $rootCategoryName = array_shift($path);
                    if (!isset($this->_categoriesWithRoots[$rootCategoryName])) {
                        $this->_categoriesWithRoots[$rootCategoryName] = array();
                    }
                    $index = $this->_implodeEscaped('/', $path);

                    $this->_categoriesWithRoots[$rootCategoryName][$index] = array(
                        'entity_id' => $category->getId(),
                        'path' => $category->getPath(),
                        'level' => $category->getLevel(),
                        'position' => $category->getPosition()
                    );

//allow importing by ids.
                    if (!isset($this->_categoriesWithRoots[$structure[1]])) {
                        $this->_categoriesWithRoots[$structure[1]] = array();
                    }
                    $this->_categoriesWithRoots[$structure[1]][$category->getId()] =
                        $this->_categoriesWithRoots[$rootCategoryName][$index];
                }
            }


            $collection = clone $this->_categoryCollection;
            $collection->removeAttributeToSelect();
            $tableName = $collection->getResource()->getEntityTable();
            $collection->getSelect()->from($tableName, ['entity_id', 'website_id', 'email']);

            $this->_byPagesIterator->iterate(
                $this->_categoryCollection,
                $this->_pageSize,
                [[$this, 'addCustomer']]
            );

            $this->_isCollectionLoaded = true;
        }
    }
public function load ( ) { if ( $ this -> _isCollectionLoaded == false ) { $ collection = Mage :: getResourceModel ( 'catalog/category_collection' ) -> addNameToResult ( ) ; /* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection */ foreach ( $ collection as $ category ) { /** @var $category Mage_Catalog_Model_Category */ $ structure = explode ( '/' , $ category -> getPath ( ) ) ; $ pathSize = count ( $ structure ) ; if ( $ pathSize > 1 ) { $ path = array ( ) ; for ( $ i = 1 ; $ i < $ pathSize ; $ i ++ ) { $ path [ ] = $ collection -> getItemById ( $ structure [ $ i ] ) -> getName ( ) ; } $ rootCategoryName = array_shift ( $ path ) ; if ( ! isset ( $ this -> _categoriesWithRoots [ $ rootCategoryName ] ) ) { $ this -> _categoriesWithRoots [ $ rootCategoryName ] = array ( ) ; } $ index = $ this -> _implodeEscaped ( '/' , $ path ) ; $ this -> _categoriesWithRoots [ $ rootCategoryName ] [ $ index ] = array ( 'entity_id' => $ category -> getId ( ) , 'path' => $ category -> getPath ( ) , 'level' => $ category -> getLevel ( ) , 'position' => $ category -> getPosition ( ) ) ; //allow importing by ids. if ( ! isset ( $ this -> _categoriesWithRoots [ $ structure [ 1 ] ] ) ) { $ this -> _categoriesWithRoots [ $ structure [ 1 ] ] = array ( ) ; } $ this -> _categoriesWithRoots [ $ structure [ 1 ] ] [ $ category -> getId ( ) ] = $ this -> _categoriesWithRoots [ $ rootCategoryName ] [ $ index ] ; } } $ collection = clone $ this -> _categoryCollection ; $ collection -> removeAttributeToSelect ( ) ; $ tableName = $ collection -> getResource ( ) -> getEntityTable ( ) ; $ collection -> getSelect ( ) -> from ( $ tableName , [ 'entity_id' , 'website_id' , 'email' ] ) ; $ this -> _byPagesIterator -> iterate ( $ this -> _categoryCollection , $ this -> _pageSize , [ [ $ this , 'addCustomer' ] ] ) ; $ this -> _isCollectionLoaded = true ; } }
Load needed data from customer collection

@return void
Load needed data from customer collection