Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapping issue for Loggable extension #306

Open
vgross opened this issue Dec 1, 2015 · 0 comments
Open

Mapping issue for Loggable extension #306

vgross opened this issue Dec 1, 2015 · 0 comments

Comments

@vgross
Copy link

vgross commented Dec 1, 2015

I have a mapping issue with the loggable extension. The extension works well to record each change and add that to the ext_log_entries table, but when I try to get a previous version by using the code in the example:

$repo = $em_report->getRepository('Gedmo\Loggable\Entity\LogEntry');
$obj = $em_report->find('Project\ReportBundle\Entity\CommissionData', 2715);
$logs = $repo->getLogEntries($obj);

I have got the issue:

"The class 'Gedmo\Tool\Wrapper\EntityWrapper' was not found in the chain configured namespaces Project\ReportBundle\Entity, Gedmo\Loggable\Entity"

here my config file

        orm:
        auto_generate_proxy_classes: "%kernel.debug%"
        #auto_mapping: true
        default_entity_manager: report
        entity_managers:
            default:
                #metadata_cache_driver: apc
                #query_cache_driver: apc
                connection: default
                mappings:
                    FOSUserBundle: ~
                    ProjectApplicationBundle: ~
                    JMSPaymentCoreBundle: ~
            report:
                #metadata_cache_driver: apc
                #query_cache_driver: apc
                connection: report
                mappings:
                    ProjectReportBundle: ~
                    gedmo_loggable:
                        type: annotation
                        prefix: Gedmo\Loggable\Entity
                        dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/Entity"
                        alias: GedmoLoggable
                        is_bundle: false

stof_doctrine_extensions:
    default_locale: en_US
    orm:
        default:
            timestampable: true
        report:
            timestampable: true       
            loggable: true

Entity:

<?php 
namespace Project\ReportBundle\Entity;

use Symfony\Component\Validator\Constraints as Assert;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;

/**
 * Project\ReportBundle\Entity\CommissionData
 *
 * @ORM\Table(name="commission_data")
 * @Gedmo\Loggable
 * @ORM\Entity(repositoryClass="Project\ReportBundle\Entity\Repository\CommissionDataRepository")
 */
class CommissionData
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

I use the code to get an old entry in a service and not in a controller, does that change something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant