public function withNameAndConstraintsPrefixedBy(string $prefix) : Table
    {
        if ($prefix === '') {
            return $this;
        }

        $indexes = [];
        foreach ($this->indexes as $index) {
            $indexes[] = $index->withNamePrefixedBy($prefix);
        }

        $foreignKeys = [];
        foreach ($this->foreignKeys as $foreignKey) {
            $foreignKeys[] = $foreignKey->withNamePrefixedBy($prefix);
        }

        return new self(
            $prefix . $this->name,
            $this->columns,
            $indexes,
            $foreignKeys
        );
    }
public function withNameAndConstraintsPrefixedBy(string $prefix) : Table
    {
        if ($prefix === '') {
            return $this;
        }

        $indexes = [];
        foreach ($this->indexes as $index) {
            $indexes[] = $index->withNamePrefixedBy($prefix);
        }

        $foreignKeys = [];
        foreach ($this->foreignKeys as $foreignKey) {
            $foreignKeys[] = $foreignKey->withNamePrefixedBy($prefix);
        }

        return new self(
            $prefix . $this->name,
            $this->columns,
            $indexes,
            $foreignKeys
        );
    }
public function withNameAndConstraintsPrefixedBy ( string $ prefix ) : Table { if ( $ prefix === '' ) { return $ this ; } $ indexes = [ ] ; foreach ( $ this -> indexes as $ index ) { $ indexes [ ] = $ index -> withNamePrefixedBy ( $ prefix ) ; } $ foreignKeys = [ ] ; foreach ( $ this -> foreignKeys as $ foreignKey ) { $ foreignKeys [ ] = $ foreignKey -> withNamePrefixedBy ( $ prefix ) ; } return new self ( $ prefix . $ this -> name , $ this -> columns , $ indexes , $ foreignKeys ) ; }
Returns a table with the name and constraints prefixed.

@param string $prefix

@return Table
Returns a table with the name and constraints prefixed .