Adds the ability to run custom initialization in derived DBOActions. Currently, you...
authorSebastian Teumert <sebastian.teumert@gmx.de>
Sun, 7 Sep 2014 10:46:41 +0000 (12:46 +0200)
committerSebastian Teumert <sebastian.teumert@gmx.de>
Sun, 7 Sep 2014 10:46:41 +0000 (12:46 +0200)
wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php

index 9392632b7819d7cf9d20e9403cf98ceb2f263175..e4215d20af56a691353965b893aca3fa40195bf0 100644 (file)
@@ -141,10 +141,19 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
                $this->action = $action;
                $this->parameters = $parameters;
                
+               // initialize further settings
+               $this->__init($baseClass, $indexName);
+               
                // fire event action
                EventHandler::getInstance()->fireAction($this, 'initializeAction');
        }
        
+       /**
+        * This function can be overridden in children to perform custom initialization
+        * of a DBOAction before the 'initializeAction' event is fired.
+        */
+       protected function __init($baseClass, $indexName) { }
+       
        /**
         * @see \wcf\data\IDatabaseObjectAction::validateAction()
         */