protected function generateMainPart(array $columns): void
  {
    $this->codeStore->append(sprintf('create procedure %s(', $this->spName));

    $padding = $this->getMaxColumnLength($columns);
    $offset  = mb_strlen($this->codeStore->getLastLine());

    $first = true;
    foreach ($columns as $column)
    {
      if ($first)
      {
        $format = sprintf(' in p_%%-%ds @%%s.%%s%%s@', $padding);
        $this->codeStore->appendToLastLine(strtolower(sprintf($format,
                                                              $column['column_name'],
                                                              $this->tableName,
                                                              $column['column_name'],
                                                              '%type')));
      }
      else
      {
        $format = sprintf('%%%ds p_%%-%ds @%%s.%%s%%s@', $offset + 3, $padding);
        $this->codeStore->append(strtolower(sprintf($format,
                                                    'in',
                                                    $column['column_name'],
                                                    $this->tableName,
                                                    $column['column_name'],
                                                    '%type')), false);
      }

      if ($column!=end($columns))
      {
        $this->codeStore->appendToLastLine(',');
      }
      else
      {
        $this->codeStore->appendToLastLine(' )');
      }

      $first = false;
    }
  }
protected function generateMainPart(array $columns): void
  {
    $this->codeStore->append(sprintf('create procedure %s(', $this->spName));

    $padding = $this->getMaxColumnLength($columns);
    $offset  = mb_strlen($this->codeStore->getLastLine());

    $first = true;
    foreach ($columns as $column)
    {
      if ($first)
      {
        $format = sprintf(' in p_%%-%ds @%%s.%%s%%s@', $padding);
        $this->codeStore->appendToLastLine(strtolower(sprintf($format,
                                                              $column['column_name'],
                                                              $this->tableName,
                                                              $column['column_name'],
                                                              '%type')));
      }
      else
      {
        $format = sprintf('%%%ds p_%%-%ds @%%s.%%s%%s@', $offset + 3, $padding);
        $this->codeStore->append(strtolower(sprintf($format,
                                                    'in',
                                                    $column['column_name'],
                                                    $this->tableName,
                                                    $column['column_name'],
                                                    '%type')), false);
      }

      if ($column!=end($columns))
      {
        $this->codeStore->appendToLastLine(',');
      }
      else
      {
        $this->codeStore->appendToLastLine(' )');
      }

      $first = false;
    }
  }
protected function generateMainPart ( array $ columns ) : void { $ this -> codeStore -> append ( sprintf ( 'create procedure %s(' , $ this -> spName ) ) ; $ padding = $ this -> getMaxColumnLength ( $ columns ) ; $ offset = mb_strlen ( $ this -> codeStore -> getLastLine ( ) ) ; $ first = true ; foreach ( $ columns as $ column ) { if ( $ first ) { $ format = sprintf ( ' in p_%%-%ds @%%s.%%s%%s@' , $ padding ) ; $ this -> codeStore -> appendToLastLine ( strtolower ( sprintf ( $ format , $ column [ 'column_name' ] , $ this -> tableName , $ column [ 'column_name' ] , '%type' ) ) ) ; } else { $ format = sprintf ( '%%%ds p_%%-%ds @%%s.%%s%%s@' , $ offset + 3 , $ padding ) ; $ this -> codeStore -> append ( strtolower ( sprintf ( $ format , 'in' , $ column [ 'column_name' ] , $ this -> tableName , $ column [ 'column_name' ] , '%type' ) ) , false ) ; } if ( $ column != end ( $ columns ) ) { $ this -> codeStore -> appendToLastLine ( ',' ) ; } else { $ this -> codeStore -> appendToLastLine ( ' )' ) ; } $ first = false ; } }
Generates the function name and parameters of the stored routine.

@param array[] $columns Columns from table.
Generates the function name and parameters of the stored routine .