I am stuck with implementing some criteria-based counters on a
relation.

For a plain related object counter, i found the "CountCache" example
in the "more with symfony" book.
http://www.symfony-project.org/more-with-symfony/1_4/en/08-Advanced-Doctrine-Usage

I think this comes pretty close to what i want, but:
- i dont necessarily need a behaviour, but..
- several custom counters with different criteria

The 2 models look basically like this:

DanceClass
  hasMany Participants
  - numParticipantsConfirmed
  - numParticipantsConfirmedLead
  - numParticipantsConfirmedFollow
  - numParticipantsUnconfirmed
(with the numParticipants... fields beeing the criteria based
counters)

Participants
  - confirmed: bool
  - role: enum(Lead | Follow)

The counters need to be updated every time a Participant Record is
created, updated or deleted.
I guess i need to set up some kind of listener to hook into
Participant model save() etc or even dql updates.

Any suggestions on how to implement this? I am a symfony newbie. Thank
you.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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

Reply via email to