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]>
> 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].
> 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.