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
767271
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));
    }
1149098
public function isColumnsToRepeatAtLeftSet() {
		if (is_array($this->_columnsToRepeatAtLeft)) {
			if ($this->_columnsToRepeatAtLeft[0] != '' && $this->_columnsToRepeatAtLeft[1] != '') {
				return true;
			}
		}

		return false;
	}
741523
public function getUnclassifiedPrimaryKeys()
    {
        $pks = [];
        foreach ($this->getMiddleTable()->getPrimaryKey() as $pk) {
            //required
            $unclassified = true;
            if ($this->getIncomingForeignKey()->hasLocalColumn($pk)) {
                $unclassified = false;
            }
            if ($unclassified) {
                foreach ($this->getCrossForeignKeys() as $crossFK) {
                    if ($crossFK->hasLocalColumn($pk)) {
                        $unclassified = false;
                        break;
                    }
                }
            }
            if ($unclassified) {
                $pks[] = $pk;
            }
        }

        return $pks;
    }
746075
public function getPrimaryKey()
    {
        $columns = $this->getColumns();

        if (!isset($columns)) {
            throw new DatabaseException('Column schema not found!');
        }

        if (count($columns) > 0) {
            $primaryKey = null;
            foreach ($columns as $key => $value) {
                if ($value['COLUMN_KEY'] == 'PRI' || $value['EXTRA'] == 'auto_increment') {
                    $primaryKey = $value['COLUMN_NAME'];
                    break;
                }
            }
        }

        return $primaryKey;
    }
169462
public function save() : bool
    {
        if (!$this->isTableNameSet()) {
            return false;
        }
        $pkName = $this->primaryKey;
        if ((int) $this->$pkName > 0) {
            $this->updateEntry();
        } else {
            $this->createEntry();
        }
        return true;
    }
1197110
protected function checkForTranslationTable() : bool
    {
        if (nb_strEndsWith($this->table_name, NABU_LANG_TABLE_SUFFIX)) {
            $table_descriptor = $this->getStorageDescriptor();
            $this->translated_table = substr($this->table_name, 0, strlen($this->table_name) - strlen(NABU_LANG_TABLE_SUFFIX));
            if ($table_descriptor->hasPrimaryConstraint() &&
                ($this->translated_desc = $this->db_syntax->describeStorage($this->translated_table, $this->schema_name)) &&
                $this->translated_desc->getPrimaryConstraintSize() + 1 === $table_descriptor->getPrimaryConstraintSize()
            ) {
                $key_diff = array_diff(
                    $table_descriptor->getPrimaryConstraintFieldNames(),
                    $this->translated_desc->getPrimaryConstraintFieldNames()
                );
                $this->is_translation = (count($key_diff) === 1 && array_shift($key_diff) === NABU_LANG_FIELD_ID);
            }
        } else {
            $this->is_translation = false;
        }

        return $this->is_translation;
    }
663830
public function isForeignKeyIgnored($foreignKey)
    {
        // do not create entities for many2many tables
        if ($this->getConfig()->get(FormatterInterface::CFG_SKIP_M2M_TABLES) && $foreignKey->getReferencedTable()->isManyToMany()) {
            return true;
        }

        return false;
    }
1116397
protected function isDeleteCascadeEmulationNeeded()
    {
        $table = $this->getTable();
        if ((!$this->getPlatform()->supportsNativeDeleteTrigger() || $this->getBuildProperty('generator.objectModel.emulateForeignKeyConstraints')) && count($table->getReferrers()) > 0) {
            foreach ($table->getReferrers() as $fk) {
                if ( ForeignKey::CASCADE === $fk->getOnDelete()) {
                    return true;
                }
            }
        }

        return false;
    }
1185498
public function isLocalPrimaryKey()
    {
        $localPKCols = [];
        foreach ($this->parentTable->getPrimaryKey() as $lPKCol) {
            $localPKCols[] = $lPKCol->getName();
        }

        return count($localPKCols) === count($this->localColumns) && !array_diff($localPKCols, $this->localColumns);
    }
356477
public function getPrimaryKeyQuery() {
        if (!empty($this->primaryKey)
            && $this->hasAttribute($this->primaryKey)) {
            return static::query()->where($this->primaryKey,
                $this->getAttributeSource($this->primaryKey));
        }
        return false;
    }
1322655
protected function _primaryKeyValue()
    {
        $fields = (array)$this->_table()->getPrimaryKey();
        $values = [];
        foreach ($fields as $field) {
            $values[] = $this->_deriveFieldFromContext($field);
        }

        if (count($values) === 1) {
            return $values[0];
        }

        return $values;
    }
766375
public function primary()
    {
        $columns = array_filter($this->_props, function($property) {
            return $property->type->options()->primary;
        });

        if(empty($columns))
            throw new Exception("No primary key defined for {$this->_class}");

        return $columns;
    }
1317003
public function primary()
    {
        $key = $this->tableHasPrimary()->getPrimaryKey();
        $message = "The column {$this->name} is not a primary key.";

        return $this->assertTrue(in_array($this->name, $key->getColumns()), $message)
                    ->assertTrue($key->isPrimary())
                    ->assertTrue($key->isUnique());
    }
894039
public function has(int $primaryKey) : bool
    {
        foreach ($this->rows as $row) {
            if ($row->getColumn($this->primaryKey) === $primaryKey) {
                return true;
            }
        }

        return false;
    }
424214
public function comparePrimaryKeys(PrimaryKey $oldPrimaryKey, PrimaryKey $newPrimaryKey)
    {
        return ($oldPrimaryKey->getName() !== $newPrimaryKey->getName())
            || ($oldPrimaryKey->getColumnNames() !== $newPrimaryKey->getColumnNames());
    }
1190699
public function isColumnsToRepeatAtLeftSet()
    {
        if (is_array($this->columnsToRepeatAtLeft)) {
            if ($this->columnsToRepeatAtLeft[0] != '' && $this->columnsToRepeatAtLeft[1] != '') {
                return true;
            }
        }

        return false;
    }
990659
public function getPrimaryKey()
    {
        if (null === $this->primary) {
            $metadata = $this->getMetadata();
            $constraints = $metadata->getConstraints($this->getTable());

            foreach ($constraints as $constraint) {
                if ($constraint->getType() == 'PRIMARY KEY') {
                    $this->primary = $constraint->getColumns();
                }
            }
        }

        return $this->primary;
    }