private function isOneToOne($primaryKey, $foreignKey, $modelTablePrimary)
    {
        if ($foreignKey->foreignField == $modelTablePrimary) {
            if ($foreignKey->localField == $primaryKey) {
                return true;
            }
        }

        return false;
    }
private function isOneToOne($primaryKey, $foreignKey, $modelTablePrimary)
    {
        if ($foreignKey->foreignField == $modelTablePrimary) {
            if ($foreignKey->localField == $primaryKey) {
                return true;
            }
        }

        return false;
    }
private function isOneToOne ( $ primaryKey , $ foreignKey , $ modelTablePrimary ) { if ( $ foreignKey -> foreignField == $ modelTablePrimary ) { if ( $ foreignKey -> localField == $ primaryKey ) { return true ; } } return false ; }
Detects if one to one relationship is there
If foreign key of table is primary key of foreign table
Also foreign key field is primary key of this table.

@param string              $primaryKey
@param GeneratorForeignKey $foreignKey
@param string              $modelTablePrimary

@return bool
Detects if one to one relationship is there If foreign key of table is primary key of foreign table Also foreign key field is primary key of this table .