public function detectForeignKey($config, $class) {
        $foreignKey = $this->getConfig($config);

        if (!$foreignKey) {
            $foreignKey = $this->buildForeignKey($class);

            $this->setConfig($config, $foreignKey);
        }

        return $foreignKey;
    }
public function detectForeignKey($config, $class) {
        $foreignKey = $this->getConfig($config);

        if (!$foreignKey) {
            $foreignKey = $this->buildForeignKey($class);

            $this->setConfig($config, $foreignKey);
        }

        return $foreignKey;
    }
public function detectForeignKey ( $ config , $ class ) { $ foreignKey = $ this -> getConfig ( $ config ) ; if ( ! $ foreignKey ) { $ foreignKey = $ this -> buildForeignKey ( $ class ) ; $ this -> setConfig ( $ config , $ foreignKey ) ; } return $ foreignKey ; }
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
Return a foreign key either for the primary or related model . If no foreign key is defined automatically inflect one and set it .