Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Versioning translatable entities in Doctrine (symfony2)

What would be the best way to integrate versioning system of some entity which uses gedmo translatable behaviour?

Gedmo Loggable does not seem to work like this:

/**
 * @ORM\Entity(repositoryClass="Alef\JobOffersBundle\Repository\JobOfferRepository")
 * @ORM\Table(name="alef_job_offer")
 * @Gedmo\Loggable
 */
class JobOffer implements Loggable, Translatable, UserOwnerInterface {

    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @ORM\ManyToOne(targetEntity="Alef\UserBundle\Entity\User")
     * @ORM\JoinColumn(name="id_user", referencedColumnName="id")
     */
    protected $user;

    /**
     * @var datetime $created
     *
     * @Gedmo\Timestampable(on="create")
     * @ORM\Column(name="created", type="datetime")
     */
    protected $created;

    /**
     * @var datetime $updatedAt
     *
     * @ORM\Column(type="datetime")
     * @Gedmo\Timestampable(on="update")
     */
    protected $updatedAt;

    /**
     * @Gedmo\Versioned
     * @Gedmo\Translatable
     * @ORM\Column(name="title", type="string", length=255)
     */
    protected $title;

    /**
     *
     * @Gedmo\Versioned
     * @Gedmo\Translatable
     * @ORM\Column(name="description", type="text")
     */
    protected $description;

    [...]

I get empty data field in ext_logged_entries.

Or maybe there is a better way to store translatable and versioned entities? Maybe not using Gedmo doctrine extensions?

like image 997
Kaminari Avatar asked Jun 15 '12 11:06

Kaminari


1 Answers

It is not possilbe to use Loggable and Translatable togetther. Have a look here.

like image 182
Tuxes3 Avatar answered Sep 27 '22 21:09

Tuxes3