original_string: public function detectForeignKey($config, $class) {
          $foreignKey = $this->getConfig($config);
  
          if (!$foreignKey) {
              $foreignKey = $this->buildForeignKey($class);
  
              $this->setConfig($config, $foreignKey);
          }
  
          return $foreignKey;
      }
code: public function detectForeignKey($config, $class) {
          $foreignKey = $this->getConfig($config);
  
          if (!$foreignKey) {
              $foreignKey = $this->buildForeignKey($class);
  
              $this->setConfig($config, $foreignKey);
          }
  
          return $foreignKey;
      }
code_tokens: public function detectForeignKey ( $ config , $ class ) { $ foreignKey = $ this -> getConfig ( $ config ) ; if ( ! $ foreignKey ) { $ foreignKey = $ this -> buildForeignKey ( $ class ) ; $ this -> setConfig ( $ config , $ foreignKey ) ; } return $ foreignKey ; }
docstring: Return a foreign key either for the primary or related model.
  If no foreign key is defined, automatically inflect one and set it.
  
  @param string $config
  @param string $class
  @return string
docstring_tokens: Return a foreign key either for the primary or related model . If no foreign key is defined automatically inflect one and set it .