I have a Download Group with just two rows: id, groupName
This is ManyToOne to Product entity. When I want to delete a Download Group
standalone, I use this:

              $object = $em->find('Entities\DownloadGroup', $_GET['id']);

              if ($object !== null) {

                  $group_name = $object->getGroupName();

                  $em->remove($object);

                  $em->flush();


                  $error = false;

                  $message = "Download group ($group_name) has been
deleted.";

              } else {


    $error = true;

                  $message = "Invalid download group.";

              }
I use getGroupName() before deleting to get the download group name to
prepare the message for EventLog.
But on deleting I get E_NOTICE:
Undefined index: productId in
/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php
on line 121
productId property belongs to Product entity not to DownloadGroup. I am not
using cascade deletion too. the deleted download group may not have an
assigned product too.
If I remove getGroupName() from code above, I won't get the notice any
more. But I need it for EventLog, so how can I fix that notice message that
is related to Product entity? please advice.Look forward to hear from you.

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to