Here's a favorite trick of mine when I use *_Db_Table:


    public function insert(array $data)
    {
        $data = array_intersect_key($data, array_fill_keys($this->info('cols'), 
''));
        return parent::insert($data);
    }

    public function update(array $data, $where)
    {
        $data = array_intersect_key($data, array_fill_keys($this->info('cols'), 
''));
        return parent::update($data, $where);
    }


On 16/02/2009 9:29 AM, Joó Ádám wrote:
Hey Joó,

Just Ádám, please (eastern order)

seeing as you do of course validate your form before you insert the
data into your table, you can use $table->insert($form->getValues()).
This should give you the desired result.

No, it's still there since it has a name attribute and therefore the
browser thinks it carries a value too, so it appends it to the POST
data. And insert() complains about the unknown submit column.


Regards,
Ádám

Reply via email to