private function generateSP(string $tableName, string $spType, string $spName): string
  {
    switch ($spType)
    {
      case 'UPDATE':
        $routine = new UpdateRoutine($this->input,
                                     $this->output,
                                     $this->helper,
                                     $spType,
                                     $spName,
                                     $tableName,
                                     $this->dataSchema);
        break;

      case 'DELETE':
        $routine = new DeleteRoutine($this->input,
                                     $this->output,
                                     $this->helper,
                                     $spType, $spName,
                                     $tableName,
                                     $this->dataSchema);
        break;

      case 'SELECT':
        $routine = new SelectRoutine($this->input,
                                     $this->output,
                                     $this->helper,
                                     $spType, $spName,
                                     $tableName,
                                     $this->dataSchema);
        break;

      case 'INSERT':
        $routine = new InsertRoutine($this->input,
                                     $this->output,
                                     $this->helper,
                                     $spType,
                                     $spName,
                                     $tableName,
                                     $this->dataSchema);
        break;

      default:
        throw new FallenException("Unknown type '%s'", $spType);
    }

    return $routine->getCode();
  }
private function generateSP(string $tableName, string $spType, string $spName): string
  {
    switch ($spType)
    {
      case 'UPDATE':
        $routine = new UpdateRoutine($this->input,
                                     $this->output,
                                     $this->helper,
                                     $spType,
                                     $spName,
                                     $tableName,
                                     $this->dataSchema);
        break;

      case 'DELETE':
        $routine = new DeleteRoutine($this->input,
                                     $this->output,
                                     $this->helper,
                                     $spType, $spName,
                                     $tableName,
                                     $this->dataSchema);
        break;

      case 'SELECT':
        $routine = new SelectRoutine($this->input,
                                     $this->output,
                                     $this->helper,
                                     $spType, $spName,
                                     $tableName,
                                     $this->dataSchema);
        break;

      case 'INSERT':
        $routine = new InsertRoutine($this->input,
                                     $this->output,
                                     $this->helper,
                                     $spType,
                                     $spName,
                                     $tableName,
                                     $this->dataSchema);
        break;

      default:
        throw new FallenException("Unknown type '%s'", $spType);
    }

    return $routine->getCode();
  }
private function generateSP ( string $ tableName , string $ spType , string $ spName ) : string { switch ( $ spType ) { case 'UPDATE' : $ routine = new UpdateRoutine ( $ this -> input , $ this -> output , $ this -> helper , $ spType , $ spName , $ tableName , $ this -> dataSchema ) ; break ; case 'DELETE' : $ routine = new DeleteRoutine ( $ this -> input , $ this -> output , $ this -> helper , $ spType , $ spName , $ tableName , $ this -> dataSchema ) ; break ; case 'SELECT' : $ routine = new SelectRoutine ( $ this -> input , $ this -> output , $ this -> helper , $ spType , $ spName , $ tableName , $ this -> dataSchema ) ; break ; case 'INSERT' : $ routine = new InsertRoutine ( $ this -> input , $ this -> output , $ this -> helper , $ spType , $ spName , $ tableName , $ this -> dataSchema ) ; break ; default : throw new FallenException ( "Unknown type '%s'" , $ spType ) ; } return $ routine -> getCode ( ) ; }
Generate code for stored routine.

@param string $tableName The table name.
@param string $spType    Stored routine type {insert|update|delete|select}.
@param string $spName    Stored routine name.

@return string
Generate code for stored routine .