Developers

License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The max_rating parameter sets the maximum rating available for an object
(this must be an integer greater than 0 - default is 5)

The rating_field parameter, which refer to a float
column in phpName format of your ratable object table which will store cached
value of actual rating for the object. Useful for queries performances and
sorting ;)

The reference_field parameter sets the name of the field where you
store the identifier of the object to rate. By default, the plugin will use
the primary key of the object. You must return an integer fo referencing a
custom identifier.

Ensure rating consistency

A clean way to ensure rating consistency is to associate a rating to a unique
identified user reference stored server side, typically the primary key of a
user record in your database.

If no user reference can be retrieved, the plugin will rely on cookies, but you
should consider this alternative solution with caution, as cookies are easily
deletable by the user.

User reference retrieval configuration

By default, the plugin will search for an sfGuardPlugin(/plugins/sfGuardPlugin sfGuardPlugin)
installation to retrieve authenticated user primary key. If you are using sfGuard,
you have nothing more to configure.

If you don't use sfGuard, you can specify the way a unique user reference (eg.
primary key) will be retrieved, using these available plugin settings in your
app.yml file:

You can specify a PHP function, eg. get_connected_user_id():

rating:
user_id_getter: get_connected_user_id

Or a static method of a PHP class, eg.
MyCustomUtilsClass::getConnectedUserId():

The return value of these calls should always be the primary key of your
connected user.

Using the Ajax rating system

This plugin provides an Ajax-based rating system, with pretty stars to click on.
You must note that this web module is provided for illustration purpose, it has
weak chances to fit exactly your project needs.

To activate this feature, you must enable the sfRating module in the
config/settings.yml file of the app you want to use the helper in :

all:
.settings:
enabled_modules: [sfRating](default,)

If you are under Microsoft Windows, you also have to manually copy the ./web
directory of the plugin in the %SF_ROOT_DIR%/web directory of your project
and rename it to sfPropelActAsRatableBehaviorPlugin. Then you will have
this on the filesytem :

sfRatings table has been renamed to sf_ratings: you have to
rebuild your SQL files and insert them in your DB if you upgrade from
0.5.0. Hopefully, one day we'll have a migration system in Symfony core...

Removed configuration file to set up Propel object to unit test in the test
suite