Hi,

interesting approach, thanks, I would never have thought of this :-/
Is there a way to implement the creation of the fictive is_import column
automatically in the dump when doing the task doctrine:data-dump?

Georg

Alexandre Salomé schrieb:
> You shouldn't handle the question like this...
> 
> A proper way :
> 
> In your fixtures, add a fictive column : "is_import"
> 
> For example :
> 
>     myModel:
>       mm_01:
>         name: Bobby
>         is_active: true
>         is_import: true
> 
> 
> In your class, add :
> 
>     protected $isImport = false;
> 
>     public function setIsImport($value)
>     {
>       $this->isImport = $value;
>     }
> 
> 
> And in your postInsert, just test :
> 
>     if ($this->isImport)
>     {
>       // your stuff
>     }
> 
> 
> Nicest way,
> 
> Alexandre
> 
> 2009/12/4 Georg Gell <geor...@have2.com <mailto:geor...@have2.com>>
> 
>     Hello group,
> 
>     how can I check in a model class if the class is used from the
>     doctrine:data-load task instead from the normal application?
> 
>     Example model "Model"
> 
>     class Model extends BaseModel
>     {
>     public function postInsert($event)
>     {
>     if (not in "symfony doctrine:data-load"){
>     //do some wild things that don't need to be done for each reload
>     }
>     }
>     }
> 
>     Thanks a lot
>     Georg
> 
>     --
> 
>     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
>     <mailto:symfony-users@googlegroups.com>.
>     To unsubscribe from this group, send email to
>     symfony-users+unsubscr...@googlegroups.com
>     <mailto:symfony-users%2bunsubscr...@googlegroups.com>.
>     For more options, visit this group at
>     http://groups.google.com/group/symfony-users?hl=en.
> 
> 
> 
> 
> 
> -- 
> Alexandre Salomé -- alexandre.sal...@gmail.com
> <mailto:alexandre.sal...@gmail.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-us...@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.

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@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