Hello.

I am trying to overwrite the filename in save method of validated file to 
content of some column of the model in sfForm (sfFormDoctrine).

I found, that it is not possible. 

For example my model:

Image:
  columns:
    name: 
      type: string(20)
      unique: true
    file:
      type: string(255)
  
And in the model class:
class Image extends sfDoctrineRecord {
  public function generatefileFilename($file)
  {
    if (!empty($this->name)) 
    {
      return $this->name.$file->getExtension($file->getOriginalExtension));
    }
    return $file->generateFilename();
  }
}

But my problem is, that the method is called before the population of object 
with the values, so the name is empty when generating the filename.

So there is now way to give a name of the file the value of another column. 

Shouldn't be there a way to save the files after the population of the object 
with non file values and then save the file in the form and fill the form 
fields with file name?

Thanks
-- 
adrive

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to