public function getForeignKeyAttributes(): array
    {
        $foreignKeys = [];

        foreach ($this->entityMap->getLocalRelationships() as $relation) {
            // If the actual relationship is a non-loaded proxy, we'll simply retrieve
            // the foreign key pair without parsing the actual object. This will allow
            // user to modify the actual related ID's directly by updating the corresponding
            // attribute.
            if ($this->isNonLoadedProxy($relation)) {
                $foreignKeys = $foreignKeys + $this->getForeignKeyAttributesFromNonLoadedRelation($relation);
                continue;
            }

            // check if relationship has been parsed, meaning it has an actual object
            // in the entity's attributes
            if ($this->isActualRelationships($relation)) {
                $foreignKeys = $foreignKeys + $this->getForeignKeyAttributesFromRelation($relation);
            } else {
                $foreignKeys = $foreignKeys + $this->getNullForeignKeyFromRelation($relation);
            }
        }

        if (!is_null($this->parent)) {
            $foreignKeys = $this->getForeignKeyAttributesFromParent() + $foreignKeys;
        }

        return $foreignKeys;
    }