php – HOW can I implement a logic hooks with sugarcrm?

I want to implement a Sugar Logic Hook that fires when invoice status becomes validated.
This my logic hook :
<?php $hook_version = 1; $hook_array = Array(); $hook_array('after_save') = Array(); $hook_array('after_save')() = Array(1, 'status invoices Changes', '/var/www/html/suitecrm/modules/AOS_Invoices/AOS_LogicHooks.php','AOS_LogicHooks', 'statusInvoicesChanges'); ?>
This is my action class:
<?php class AOS_LogicHooks { public function statusInvoicesChanges (SugarBean $bean, $event, $arguments){ if($dictionary('AOS_Invoices')('fields')('status')='validated'){ $GLOBALS('log')->fatal("Status has been changed"); }}} ?>
What do I missing?