Hi!

I have a doctrine model like this:

Asset:
  columns:
    filename: { type: string(255), notnull: false, unique: true }
    filesize: { type: integer, notnull: true }

In the saving process I want to check if the user has left the
filename empty. In that case i want to set the filename with the id of
the object.

The problem is that I don't know where the Id of the object is aviable
in the saving process. ¿have I to do it in the doSave method? ¿after o
before calling the parent::doSave????

I want to do something like this:

public function doSave($con = null)
    {

        if(null === $this->getObject()->getFilename()){
            $this->getObject()->setFilename($this->getObject()-
>getId());
        }

        parent::doSave($con);
    }

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to