Skip to content

Instantly share code, notes, and snippets.

@heptat
Created March 30, 2012 01:31
Show Gist options
  • Save heptat/2245579 to your computer and use it in GitHub Desktop.
Save heptat/2245579 to your computer and use it in GitHub Desktop.
update
<?php
static::applyFilter('save', function($self, $params, $chain) {
// TODO if they are applying for concession, write this to the mysql_
// "registrations" table
$data = $params['entity']->data();
if ($data['registration_fee_type'] == 'concession') {
$registration = Registrations::first(array('conditions' => array('id' => $data['registration_id'])));
$registration->concession_applied_for = 1;
$registration->save(null, array('validate' => false));
}
$data = $chain->next($self, $params, $chain);
return $data;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment