OEModule\PASAPI\controllers\V1Controller::createAction PHP Метод

createAction() публичный Метод

This is necessary because there's no way of pushing the appropriate pattern to the top of the URLManager config, so this captures calls where the id doesn't contain non-numerics.
public createAction ( string $actionID ) : CAction | CInlineAction
$actionID string
Результат CAction | CInlineAction
    public function createAction($actionID)
    {
        if (in_array($actionID, static::$resources)) {
            $_GET['resource_type'] = $actionID;
            switch (\Yii::app()->getRequest()->getRequestType()) {
                case 'PUT':
                    return parent::createAction('Update');
                    break;
                case 'DELETE':
                    return parent::createAction('Delete');
                    break;
                default:
                    $this->sendResponse(405);
                    break;
            }
        }
        return parent::createAction($actionID);
    }