-
Notifications
You must be signed in to change notification settings - Fork 1
Developer API
ProLoser edited this page Sep 14, 2010
·
7 revisions
function _owner($id)
Checks to see if the current user is the owner of the record and sets a boolean variable to the view
-
$idint The record id to be checked for ownership of. Only checks the current model
function _subscriber($id)
Checks to see if the current user is a subscriber and sends subscription info to the view
-
$idint The record id to be checked for subscription to. Only checks on the current model
function grantPoints($event, $userId, $foreignId = null)
Function for granting a user points via a point event. Requires that you pass a string id key for the point event and the target user’s id.
-
$eventstring The PointEvent.id key that the user is being given points for -
$userIdint The User.id key that is being given points -
$foreignIdint Optional primary id of the related model-record that earned the points
function afterSave($created) {
if ($created) {
$this->grantPoints(
'user-register',
$this->id
);
}
}
function afterSave($created) {
if ($created) {
$this->User->grantPoints(
'create-review',
$this->data['Review']['user_id'],
$this->id
);
}
}