I went into root/classes/modules/plugins as suggested.
I opened the UserFactory.plugin.example file.
I then proceeded to change the name from UserFactory.plugin.example to UserFactory.plugin.php
Then, I commented out the postSave function, and left the setLastName function available to run.
I saved this file, and cleared out my cache directory.
However, I don't see this plugin firing, or any reference of it in the Log file.
How do I get the plugins to trigger?
Here are the contents of the UserFactory.plugin.php file:
Code: Select all
<?php
/*$License$*/
/*
* $Revision: 4034 $
* $Id: UserFactory.plugin.php 4034 2010-12-15 00:02:50Z ipso $
* $Date: 2010-12-14 16:02:50 -0800 (Tue, 14 Dec 2010) $
*/
/*
* 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(), 'UserFactory Plugin postSave(): ', __FILE__, __LINE__, __METHOD__,10);
return TRUE;
}
*/
}
?>