Fixing content type ordering when content_type is not defined.
[akelos.git] / test / fixtures / app / models / observed_person_observer.php
blob03e7b7b8b0ddfc93dee445a3592b56d0c4f1d658
1 <?php
2 class ObservedPersonObserver extends AkObserver
4 function update($state)
6 switch ($state)
8 case "new person created" :
9 echo $state;
10 break;
11 default:
12 break;
16 function afterCreate(&$record)
18 echo $record->get("first_name")." has been email with account details";
19 $this->logNotified($record,__FUNCTION__);
22 function afterSave(&$record){$this->logNotified($record,__FUNCTION__);}
23 function afterValidationOnCreate(&$record){$this->logNotified($record,__FUNCTION__);}
24 function afterValidationOnUpdate(&$record){$this->logNotified($record,__FUNCTION__);}
25 function beforeSave(&$record){$this->logNotified($record,__FUNCTION__);
26 if(!empty($record->city) && $record->city == "Carlet")
28 $record->set('state',"Valencia");
31 function beforeCreate(&$record){$this->logNotified($record,__FUNCTION__); }
32 function beforeValidationOnCreate(&$record){$this->logNotified($record,__FUNCTION__);}
33 function beforeValidation(&$record){$this->logNotified($record,__FUNCTION__);}
34 function afterValidation(&$record) {$this->logNotified($record,__FUNCTION__);}
36 function logNotified(&$record, $function)
38 if(!isset($record->notified_observers[$function])){
39 $record->notified_observers[$function] = 0;
41 $record->notified_observers[$function]++;