src/Database/Mysqli5/MysqliDatabase.php
private function parseNameFromKeyDefinition($strKeyDefinition)
    {
        $strKeyDefinition = trim($strKeyDefinition);

        $intPosition = strpos($strKeyDefinition, '(');

        if ($intPosition === false) {
            throw new \Exception("Invalid Key Definition: $strKeyDefinition");
        } else {
            if ($intPosition == 0) // No Key Name Defined
            {
                return null;
            }
        }

        // If we're here, then we have a key name defined
        $strName = trim(substr($strKeyDefinition, 0, $intPosition));

        // Rip Out leading and trailing "`" character (if applicable)
        if (substr($strName, 0, 1) == '`') {
            return substr($strName, 1, strlen($strName) - 2);
        } else {
            return $strName;
        }
    }
private function parseNameFromKeyDefinition($strKeyDefinition)
    {
        $strKeyDefinition = trim($strKeyDefinition);

        $intPosition = strpos($strKeyDefinition, '(');

        if ($intPosition === false) {
            throw new \Exception("Invalid Key Definition: $strKeyDefinition");
        } else {
            if ($intPosition == 0) // No Key Name Defined
            {
                return null;
            }
        }

        // If we're here, then we have a key name defined
        $strName = trim(substr($strKeyDefinition, 0, $intPosition));

        // Rip Out leading and trailing "`" character (if applicable)
        if (substr($strName, 0, 1) == '`') {
            return substr($strName, 1, strlen($strName) - 2);
        } else {
            return $strName;
        }
    }
private function parseNameFromKeyDefinition ( $ strKeyDefinition ) { $ strKeyDefinition = trim ( $ strKeyDefinition ) ; $ intPosition = strpos ( $ strKeyDefinition , '(' ) ; if ( $ intPosition === false ) { throw new \ Exception ( "Invalid Key Definition: $strKeyDefinition" ) ; } else { if ( $ intPosition == 0 ) // No Key Name Defined { return null ; } } // If we're here, then we have a key name defined $ strName = trim ( substr ( $ strKeyDefinition , 0 , $ intPosition ) ) ; // Rip Out leading and trailing "`" character (if applicable) if ( substr ( $ strName , 0 , 1 ) == '`' ) { return substr ( $ strName , 1 , strlen ( $ strName ) - 2 ) ; } else { return $ strName ; } }
If the key name exists, this will parse it out and return it
If the key name exists this will parse it out and return it