Development

#7715 ([Doctrine & Propel] Forms - improve updateXXXColumn)

You must first sign up to be able to contribute.

Ticket #7715 (new enhancement)

Opened 4 years ago

[Doctrine & Propel] Forms - improve updateXXXColumn

Reported by: victor Assigned to: fabien
Priority: minor Milestone:
Component: form Version: 1.4.0 RC2
Keywords: updateXXXColumn, Propel, Doctrine Cc: vberchet-sf@yahoo.com
Qualification: Unreviewed

Description

It would be great to add the name of the field when calling the updateXXXColumn() method from processValue().
In 1.4RC2, that would mean modifying:
- sfFormDoctrine.class.php, l160: if (false === $ret = $this->$method($value*, $field*))
- sfFormPropel.class.php, l134: if (false === $ret = $this->$method($value*,$field*))

A typical use case:
- when updateXXXColumn() is used to resize an uploaded image:

  protected function update**File**Column($value)
  {
    // ...
    // resize the pic
    //
    return $this->processUploadedFile(**'file'**);
  }  

The issue here is that you have to repeat & hard code the field name ('file') on the last line. With the proposed enhancement:

  protected function update**File**Column($value, $field)
  {
    // ...
    // resize the pic
    //
    return $this->processUploadedFile($field);
  }