This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » Extensions » ezstarrating: creating contentobject...

ezstarrating: creating contentobject with ezstarrating attribute via PHP

ezstarrating: creating contentobject with ezstarrating attribute via PHP

Wednesday 22 December 2010 8:05:29 pm - 4 replies

Hi everyone,
I'm curious to find out if someone has created a contentobject with an ezstarrating attribute from PHP before. I've been looking through the forums as well as the ezstarrating extension classes for a little bit now, but wanted to make sure I'm not reinventing the wheel here.
I'm going the usual route of:
- create object (return new object)
- update via $data_map[ $key ]->fromString( $value );
- store via $data_map[ $key ]->store();
- execute content publish
I've tried simply passing in an integer of the star rating (0-5) as well as a few other combinations, but so far, no dice.
If anyone has done this before or has a hunch as to what kind of format in need to pass this in with I'd much appreciate a quick reply.

Wednesday 22 December 2010 10:08:17 pm

Thing here is ezstarrating datatype has no fromString method yet. can be a enchancement...

Wednesday 22 December 2010 11:59:16 pm

Thanks for the reply Carlos I didn't see that (obviously didn't look very closely either). Are you aware of any plans for this to be added to the extension in the future?

Thursday 23 December 2010 3:22:38 am

Benjamin, check out the rating is saved in the ajax function when you click the stars. You can use this method.

Thursday 23 December 2010 9:30:28 pm

I was thinking of using that but was hoping to be able to do it the ez standard way.
Should be the same outcome so that's fine.
Appreciate the feedback.


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from