public function isForeignPrimaryKey()
    {
        $lfmap = $this->getLocalForeignMapping();
        $foreignTable = $this->getForeignTable();

        $foreignPKCols = array();
        foreach ($foreignTable->getPrimaryKey() as $fPKCol) {
            $foreignPKCols[] = $fPKCol->getName();
        }

        $foreignCols = array();
        foreach ($this->getLocalColumns() as $colName) {
            $foreignCols[] = $foreignTable->getColumn($lfmap[$colName])->getName();
        }

        return ((count($foreignPKCols) === count($foreignCols)) && !array_diff($foreignPKCols, $foreignCols));
    }
public function isForeignPrimaryKey()
    {
        $lfmap = $this->getLocalForeignMapping();
        $foreignTable = $this->getForeignTable();

        $foreignPKCols = array();
        foreach ($foreignTable->getPrimaryKey() as $fPKCol) {
            $foreignPKCols[] = $fPKCol->getName();
        }

        $foreignCols = array();
        foreach ($this->getLocalColumns() as $colName) {
            $foreignCols[] = $foreignTable->getColumn($lfmap[$colName])->getName();
        }

        return ((count($foreignPKCols) === count($foreignCols)) && !array_diff($foreignPKCols, $foreignCols));
    }
public function isForeignPrimaryKey ( ) { $ lfmap = $ this -> getLocalForeignMapping ( ) ; $ foreignTable = $ this -> getForeignTable ( ) ; $ foreignPKCols = array ( ) ; foreach ( $ foreignTable -> getPrimaryKey ( ) as $ fPKCol ) { $ foreignPKCols [ ] = $ fPKCol -> getName ( ) ; } $ foreignCols = array ( ) ; foreach ( $ this -> getLocalColumns ( ) as $ colName ) { $ foreignCols [ ] = $ foreignTable -> getColumn ( $ lfmap [ $ colName ] ) -> getName ( ) ; } return ( ( count ( $ foreignPKCols ) === count ( $ foreignCols ) ) && ! array_diff ( $ foreignPKCols , $ foreignCols ) ) ; }
Whether this foreign key is also the primary key of the foreign table.

@return boolean Returns true if all columns inside this foreign key are primary keys of the foreign table
Whether this foreign key is also the primary key of the foreign table .