Ah, I see what you're doing. And where would I call MyModule::setUser()?

Bernhard Schussek wrote:
> I'll let the code speak.
> 
> 
> class MyModel extends ...
> {
>   private $user = null;
> 
>   public function setUser(sfUser $user)
>   {
>     $this->user = $user;
>   }
> 
>   public function save(...)
>   {
>     if (is_null($this->user))
>     {
>       throw new LogicException('User must be set before saving');
>     }
> 
>     // ... or ...
> 
>     if (!is_null($this->user))
>     {
>       // modify created at and don't modify if user is not set
>     }
>   }
> }
> 
> 
> Bernhard
> 
> > 
> 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to