/** * function deleteEntry * <pre> * Removes the child entries of Module objects before removing self. * (Poor Man's Referential Integrity) * </pre> * @return [void] */ function deleteEntry() { // first remove any associated State Variables $list = new StateVarList($this->getModuleID()); $list->setFirst(); while ($item = $list->getNext()) { $item->deleteEntry(); } // now remove any Data Access Objects $list = new DAObjList($this->getModuleID()); $list->setFirst(); while ($item = $list->getNext()) { $item->deleteEntry(); } // now remove any Page Objects $list = new PageList($this->getModuleID()); $list->setFirst(); while ($item = $list->getNext()) { $item->deleteEntry(); } // now remove any Transitions $list = new TransitionsList($this->getModuleID()); $list->setFirst(); while ($item = $list->getNext()) { $item->deleteEntry(); } // now call parent method parent::deleteEntry(); }
/** * function getCallBackParamList * <pre> * Creates a set of call back parameters given the current module id. * </pre> * @param $moduleID [INTEGER] module id of the state vars to use. * @param $skipField [STRING] name of the field to skip in the param list * @return [STRING] */ function getCallBackParamList($moduleID, $skipField = '') { // get list of this module's state vars $stateVarList = new StateVarList($moduleID); // for each statevar object $callbackParamList = ''; $stateVarList->setFirst(); while ($stateVar = $stateVarList->getNext()) { $stateVarName = $stateVar->getName(); if ($stateVarName != $skipField) { if ($callbackParamList != '') { $callbackParamList .= ', '; } $callbackParamList .= '\'' . $stateVarName . '\'=>$this->' . $stateVarName; } else { // $callbackParamList .= ', ""'; } } return $callbackParamList; }