TimeTrex Community Edition v16.2.0
This commit is contained in:
28
classes/modules/plugins/UserFactory.plugin.example
Normal file
28
classes/modules/plugins/UserFactory.plugin.example
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/*$License$*/
|
||||
|
||||
|
||||
/*
|
||||
* Example plugin.
|
||||
*/
|
||||
|
||||
|
||||
//Extend the "ListFactory" if you want your plugin to affect it AND the base Factory class.
|
||||
//Extend just the "Factory" if you just want it to affect just it, and not account for objects read/modified through iterators.
|
||||
class UserFactoryPlugin extends UserListFactory {
|
||||
function setLastName( $value ) {
|
||||
//Modify last name, so it always has "-Smith" on the end.
|
||||
$value .= '-Smith';
|
||||
|
||||
return parent::setLastName( $value );
|
||||
}
|
||||
|
||||
function postSave() {
|
||||
parent::postSave(); //Make sure you always call the parents function to maintain proper code operation.
|
||||
|
||||
//User record was saved. We can do all sorts of things here like trigger real-time data exporting.
|
||||
Debug::Arr( $this->getObjectAsArray(), 'Plugin postSave(): ', __FILE__, __LINE__, __METHOD__,10);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user