<?php

/**
 * PluginProductCategory form.
 *
 * @package    ##PROJECT_NAME##
 * @subpackage form
 * @author     ##AUTHOR_NAME##
 * @version    SVN: $Id: sfDoctrineFormPluginTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
abstract class PluginProductCategoryForm extends BaseProductCategoryForm
{
	public function configure()
	{
		parent::setup();

		$this->useFields(array(
            'id', 'name', 'description'
        ));
	}

    protected function doSave($con = null)
    {
        parent::doSave($con);

        if($this->isNew())
        {
	        $node = $this->object->getNode();
	        $parent = $this->object->getTable()->getTree()->fetchRoot();
	        
	        if($parent)
	        {
	            $method = ($node->isValidNode() ? 'move' : 'insert') . 'AsLastChildOf';
	            $node->$method($parent); //calls $this->object->save internally
	        }
        }
    }
}

<?php

/**
 * PluginProductCategory form.
 *
 * @package    ##PROJECT_NAME##
 * @subpackage form
 * @author     ##AUTHOR_NAME##
 * @version    SVN: $Id: sfDoctrineFormPluginTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
abstract class PluginProductCategoryForm extends BaseProductCategoryForm
{
	public function setup()
	{
		parent::setup();

		$this->useFields(array(
            'id', 'name', 'description'
        ));
	}

    protected function doSave($con = null)
    {
        parent::doSave($con);

        if($this->isNew())
        {
	        $node = $this->object->getNode();
	        $parent = $this->object->getTable()->getTree()->fetchRoot();
	        
	        if($parent)
	        {
	            $method = ($node->isValidNode() ? 'move' : 'insert') . 'AsLastChildOf';
	            $node->$method($parent); //calls $this->object->save internally
	        }
        }
    }
}

Change configure to setup method
[ddOnlineStorePlugin] Change configure to setup method

git-svn-id: 8b8afaa04106040b671d0ed3b268285890208be0@33046 ee427ae8-e902-0410-961c-c3ed070cd9f9
