{% extends '../CommonAdmin/EditAction/EditBuilderAction.php.twig' %}
{% block getObject -%}
    protected function getObject($pk)
    {
        return $this->getDocumentManager()
                    ->getRepository('{{ model }}')
                    ->find($pk);
    }
{% endblock %}

{% block saveObject -%}
    protected function saveObject(\{{ model }} ${{ builder.ModelClass }})
    {
        $dm = $this->getDocumentManager();
        $dm->persist(${{ builder.ModelClass }});
        $dm->flush();
    }
{% endblock %}

{% extends '../CommonAdmin/EditAction/EditBuilderAction.php.twig' %}
{% block getObject -%}
    protected function getObject($pk)
    {
        $pk = is_numeric($pk) ? intval($pk) : $pk;

        return $this->getDocumentManager()
                    ->getRepository('{{ model }}')
                    ->find($pk);
    }
{% endblock %}

{% block saveObject -%}
    protected function saveObject(\{{ model }} ${{ builder.ModelClass }})
    {
        $dm = $this->getDocumentManager();
        $dm->persist(${{ builder.ModelClass }});
        $dm->flush();
    }
{% endblock %}

Fix NotFoundException when using auto incremental id
Fix NotFoundException when using auto incremental id
