original_string: protected function addRelation()
      {
          if ($this->relationType == 'hasAndBelongsToMany')
          {
              $junction = $this->getJunction();
  
              try
              {
                  Validate::table($junction)->exists();
              }
              catch (dbException $e)
              {
                  Database::create($junction, [
                      $this->tables['local'] . '_id'   => 'integer',
                      $this->tables['foreign'] . '_id' => 'integer',
                  ]);
  
                  $this->insertRelationData($junction, $this->tables['local'], 'hasMany', [
                      'local'   => $this->tables['local'] . '_id',
                      'foreign' => $this->keys['local']
                  ]);
  
                  $this->insertRelationData($junction, $this->tables['foreign'], 'hasMany', [
                      'local'   => $this->tables['foreign'] . '_id',
                      'foreign' => $this->keys['foreign']
                  ]);
              }
          }
          $this->insertRelationData($this->tables['local'], $this->tables['foreign'], $this->relationType, $this->keys);
      }
code: protected function addRelation()
      {
          if ($this->relationType == 'hasAndBelongsToMany')
          {
              $junction = $this->getJunction();
  
              try
              {
                  Validate::table($junction)->exists();
              }
              catch (dbException $e)
              {
                  Database::create($junction, [
                      $this->tables['local'] . '_id'   => 'integer',
                      $this->tables['foreign'] . '_id' => 'integer',
                  ]);
  
                  $this->insertRelationData($junction, $this->tables['local'], 'hasMany', [
                      'local'   => $this->tables['local'] . '_id',
                      'foreign' => $this->keys['local']
                  ]);
  
                  $this->insertRelationData($junction, $this->tables['foreign'], 'hasMany', [
                      'local'   => $this->tables['foreign'] . '_id',
                      'foreign' => $this->keys['foreign']
                  ]);
              }
          }
          $this->insertRelationData($this->tables['local'], $this->tables['foreign'], $this->relationType, $this->keys);
      }
code_tokens: protected function addRelation ( ) { if ( $ this -> relationType == 'hasAndBelongsToMany' ) { $ junction = $ this -> getJunction ( ) ; try { Validate :: table ( $ junction ) -> exists ( ) ; } catch ( dbException $ e ) { Database :: create ( $ junction , [ $ this -> tables [ 'local' ] . '_id' => 'integer' , $ this -> tables [ 'foreign' ] . '_id' => 'integer' , ] ) ; $ this -> insertRelationData ( $ junction , $ this -> tables [ 'local' ] , 'hasMany' , [ 'local' => $ this -> tables [ 'local' ] . '_id' , 'foreign' => $ this -> keys [ 'local' ] ] ) ; $ this -> insertRelationData ( $ junction , $ this -> tables [ 'foreign' ] , 'hasMany' , [ 'local' => $ this -> tables [ 'foreign' ] . '_id' , 'foreign' => $ this -> keys [ 'foreign' ] ] ) ; } } $ this -> insertRelationData ( $ this -> tables [ 'local' ] , $ this -> tables [ 'foreign' ] , $ this -> relationType , $ this -> keys ) ; }
docstring: Add data to configs and create all necessary files
docstring_tokens: Add data to configs and create all necessary files