if you're handling GalleryEntity::save / ::delete events for GalleryUser entities, then you first have to get the entity from the event and then call $entity->getEmail() or $entity->getId() to get what you want.
please see the "developers" and the "documentation" link in the upper right corner.
azflyer
Joined: 2005-10-24
Posts: 7
Posted: Tue, 2005-10-25 15:42
valiant wrote:
if you're handling GalleryEntity::save / ::delete events for GalleryUser entities, then you first have to get the entity from the event and then call $entity->getEmail() or $entity->getId() to get what you want.
please see the "developers" and the "documentation" link in the upper right corner.
Hi,
Thanks for the reply. I have gone through the documentation and haven't had any luck finding this particular answer. Otherwise the doumentation has been very helpful to me.
I have much of the new module working great by following the docs and other modules as examples.
What I'm actually doing is writing a notification module so when new albums or items are added to albums a notification goes out to users that have a notification flag turned on and notifications are turned on within the album settings or parent album settings. This feature is something that I wrote into Gallery 1.x which I'm still using to date and it works great. I want to move to Gallery 2 but need to have this functionality.
So during:
function handleEvent($event) {
$album = $event->getEntity();
if (GalleryUtilities::isA($album, 'GalleryItem') &&
$album->testPersistentFlag(STORAGE_FLAG_NEWLY_CREATED)) {
I need to go through all the users and grab names and email addresses of the users who have the new item notification flag turned on.
Posts: 7
Anyone know the answer to this?
Posts: 32509
if you're handling GalleryEntity::save / ::delete events for GalleryUser entities, then you first have to get the entity from the event and then call $entity->getEmail() or $entity->getId() to get what you want.
please see the "developers" and the "documentation" link in the upper right corner.
Posts: 7
Hi,
Thanks for the reply. I have gone through the documentation and haven't had any luck finding this particular answer. Otherwise the doumentation has been very helpful to me.
I have much of the new module working great by following the docs and other modules as examples.
What I'm actually doing is writing a notification module so when new albums or items are added to albums a notification goes out to users that have a notification flag turned on and notifications are turned on within the album settings or parent album settings. This feature is something that I wrote into Gallery 1.x which I'm still using to date and it works great. I want to move to Gallery 2 but need to have this functionality.
So during:
function handleEvent($event) {
$album = $event->getEntity();
if (GalleryUtilities::isA($album, 'GalleryItem') &&
$album->testPersistentFlag(STORAGE_FLAG_NEWLY_CREATED)) {
I need to go through all the users and grab names and email addresses of the users who have the new item notification flag turned on.
I hope that makes sense.
Thanks for your help.
Posts: 32509
have you seen the other notification module discussion?
http://gallery.menalto.com/node/38700
maybe you two could work together. and if not, there are some tips for you in the other topic.