Forms 如何在symfony 1.4中保存收款单

Forms 如何在symfony 1.4中保存收款单,forms,symfony-1.4,propel,Forms,Symfony 1.4,Propel,我在symfony 1.4和Propel 1.5中创建了一个收集表单,所有内容都正确显示,但我无法将表单保存到数据库中 该表单用于一次编辑多个用户 我发现了这个问题,并实施了使用sfFormPropel扩展collectionForm类的建议,但当我这样做时,我的内存就用完了。我找不到从数据库中提取的会填满进程内存的内容 在我的新保存功能中,我甚至什么都不做 有什么想法吗 class ContactCollectionForm extends sfFormPropel { public

我在symfony 1.4和Propel 1.5中创建了一个收集表单,所有内容都正确显示,但我无法将表单保存到数据库中

该表单用于一次编辑多个用户

我发现了这个问题,并实施了使用sfFormPropel扩展collectionForm类的建议,但当我这样做时,我的内存就用完了。我找不到从数据库中提取的会填满进程内存的内容

在我的新保存功能中,我甚至什么都不做

有什么想法吗

class ContactCollectionForm extends sfFormPropel
{
    public function getModelName()
    {
        return 'ContactCollectionForm';
    }

    public function retrieveSubObject($fieldname, $model)
    {
        switch($fieldname)
        {
            default:
                break;
        }
        return array();     
    }

    public function save($con = null)
    {

    }

    public function configure()
    {
        $user           = $this->getOption('user');
        $embedded       = $this->getOption('embedded');
        $custom         = $this->getOption('custom');
        $contact_list   = $this->getOption('contact_list');
        $cf             = $custom['form'];

        if(!array_key_exists(0, $cf['fields']['field']))
            $cf['fields']['field']  = array($cf['fields']['field']);

        $use_fields     = array();

        for($i=0;$i<count($contact_list);$i++)
        {
            foreach($cf['fields']['field'] as $field)
            {
                if($field['type'] == 'object')
                {
                    // embed object form (ala: PersonData, Coordinate etc...)
                    $model      = $field['model'];
                    $model_form = $model.'Form';

                    $sub_object = $contact_list[$i];

                    $sub_form   = new $model_form($sub_object, array('user' => $user, 'embedded' => true, 'custom' => $field['fields']));
                    $this->embedForm($field['name'], $sub_form);
                    array_push($use_fields, $field['name']);

                }   // end field type == object
                else
                {
                    // standard form field
                    $this->setWidget($field['name'], CustomWidgetExtender::createSfWidget($field, $user, $this));
                    $this->widgetSchema->setLabel($field['name'], $field['label']);

                    if(trim($field['default']) != '')
                        $this->setDefault($field['name'], $field['default']);

                    // add field name to use_fields array
                    array_push($use_fields, $field['name']);                
                }   // end field type != object
            }

        }
    }

}
class ContactCollectionForm扩展了SFFormPrope
{
公共函数getModelName()
{
返回“ContactCollectionForm”;
}
公共函数retrieveSubObject($fieldname,$model)
{
交换机($fieldname)
{
违约:
打破
}
返回数组();
}
公共函数保存($con=null)
{
}
公共函数配置()
{
$user=$this->getOption('user');
$embedded=$this->getOption('embedded');
$custom=$this->getOption('custom');
$contact_list=$this->getOption('contact_list');
$cf=$custom['form'];
如果(!array_key_存在(0,$cf['fields']['field']))
$cf['fields']['field']=数组($cf['fields']['field']);
$use_fields=array();
对于($i=0;$i$user,'embedded'=>true,'custom'=>$field['fields']);
$this->embedForm($field['name'],$sub_form);
数组推送($use_fields,$field['name']);
}//结束字段类型==对象
其他的
{
//标准表单字段
$this->setWidget($field['name'],CustomWidgetExtender::createSfWidget($field,$user,$this));
$this->widgetSchema->setLabel($field['name'],$field['label']);
如果(修剪($field['default'])!='')
$this->setDefault($field['name'],$field['default']);
//添加字段名以使用\u字段数组
数组推送($use_fields,$field['name']);
}//结束字段类型!=对象
}
}
}
}

我最终做了一个粗略的尝试,手动处理每个表单,而不是试图将这种类型的表单硬塞进symfony 1.x表单框架中