Gpf_Rpc_Action::getParam PHP Method

getParam() public method

public getParam ( $name )
        public function getParam($name)
        {
            return $this->params->get($name);
        }

Usage Example

コード例 #1
0
    /**
     * @service theme write
     */
    public function revertFile(Gpf_Rpc_Params $params) {
        $action = new Gpf_Rpc_Action($params);
        try{
            $themeId = $action->getParam('themeId');
            $itemId = $action->getParam("Id");
            $themeBase = $this->getThemeFile($action->getParam('panelName'));

            $file_original = new Gpf_Io_File($themeBase.'/'.Gpf_Paths::DEFAULT_THEME.$itemId);
            $file_new = new Gpf_Io_File($themeBase.'/'.$themeId.$itemId);

            if($file_original->isExists() && $file_new->isExists()){
                if(!$file_new->delete()){
                    throw new Gpf_Exception(_("Revert of file has failed"));
                }else{
                    $action->setInfoMessage(_("Revert of file success"));
                }
            }else{
                $action->setInfoMessage(_("This file cannot be reverted"));
            }
            $action->addOk();
        }catch (Gpf_Exception $e){
            $action->addError();
            $action->setErrorMessage($e->getMessage());
        }
        return $action;
    }
All Usage Examples Of Gpf_Rpc_Action::getParam