Maybe the "toArray" method must be overriden. Not sure,
Alexandre 2009/12/7 Georg Gell <[email protected]> > 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 <[email protected] <mailto:[email protected]>> > > > > 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 [email protected] > > <mailto:[email protected]>. > > To unsubscribe from this group, send email to > > > > [email protected]<symfony-users%[email protected]> > > > > <mailto:symfony-users%[email protected]<symfony-users%[email protected]> > >. > > For more options, visit this group at > > http://groups.google.com/group/symfony-users?hl=en. > > > > > > > > > > > > -- > > Alexandre Salomé -- [email protected] > > <mailto:[email protected]> > > > > -- > > > > 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]<symfony-users%[email protected]> > . > > 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]<symfony-users%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en. > > > -- Alexandre Salomé -- [email protected] -- 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.
