src/Plugins/ChildrenCountPlugin.php
public function process()
    {

        // load all available categories
        $categories = $this->getImportProcessor()->getCategories();

        // update the categories children count
        foreach ($categories as $category) {
            // load the category itself
            $this->category = $this->loadCategory($pk = $this->getPrimaryKey($category));

            // update the category's children count
            $this->persistCategory($this->initializeCategory($this->prepareAttributes()));

            // write a log message
            $this->getSystemLogger()->debug(
                sprintf('Successfully updated category with primary key %d', $pk)
            );
        }
    }
public function process()
    {

        // load all available categories
        $categories = $this->getImportProcessor()->getCategories();

        // update the categories children count
        foreach ($categories as $category) {
            // load the category itself
            $this->category = $this->loadCategory($pk = $this->getPrimaryKey($category));

            // update the category's children count
            $this->persistCategory($this->initializeCategory($this->prepareAttributes()));

            // write a log message
            $this->getSystemLogger()->debug(
                sprintf('Successfully updated category with primary key %d', $pk)
            );
        }
    }
public function process ( ) { // load all available categories $ categories = $ this -> getImportProcessor ( ) -> getCategories ( ) ; // update the categories children count foreach ( $ categories as $ category ) { // load the category itself $ this -> category = $ this -> loadCategory ( $ pk = $ this -> getPrimaryKey ( $ category ) ) ; // update the category's children count $ this -> persistCategory ( $ this -> initializeCategory ( $ this -> prepareAttributes ( ) ) ) ; // write a log message $ this -> getSystemLogger ( ) -> debug ( sprintf ( 'Successfully updated category with primary key %d' , $ pk ) ) ; } }
Process the plugin functionality.

@return void
@throws \Exception Is thrown, if the plugin can not be processed
Process the plugin functionality .