Permalink
Browse files

implemented Loggable doctrine extension for bricks

  • Loading branch information...
inmarelibero committed Oct 28, 2012
1 parent 19770af commit 54872d848650acef55a992ce932e3d8e1130fbe0
View
@@ -40,6 +40,13 @@ doctrine:
orm:
auto_generate_proxy_classes: %kernel.debug%
auto_mapping: true
+ mappings:
+ gedmo_loggable:
+ type: annotation
+ prefix: Gedmo\Loggable\Entity
+ dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/Entity"
+ alias: GedmoLoggable # this one is optional and will default to the name set for the mapping
+ is_bundle: false
# Swiftmailer Configuration
swiftmailer:
@@ -76,3 +83,4 @@ stof_doctrine_extensions:
default:
timestampable: true
sluggable: true
+ loggable: true
@@ -8,8 +8,10 @@
/**
* Bricks\SiteBundle\Entity\Brick
*
- * @ORM\Table()
+ * @ORM\Table("brick")
* @ORM\Entity(repositoryClass="Bricks\SiteBundle\Entity\BrickRepository")
+ *
+ * @Gedmo\Loggable(logEntryClass="Bricks\SiteBundle\Entity\BrickLogEntry")
*/
class Brick
{
@@ -25,20 +27,23 @@ class Brick
/**
* @var text $title
*
+ * @Gedmo\Versioned
* @ORM\Column(type="text")
*/
private $title;
/**
* @var text $description
*
+ * @Gedmo\Versioned
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @var text $content
*
+ * @Gedmo\Versioned
* @ORM\Column(type="text", nullable=true)
*/
private $content;
@@ -52,6 +57,7 @@ class Brick
/**
* @var boolean $published
*
+ * @Gedmo\Versioned
* @ORM\Column(type="boolean", nullable=true)
*/
private $published;
@@ -0,0 +1,16 @@
+<?php
+
+namespace Bricks\SiteBundle\Entity;
+
+use Doctrine\ORM\Mapping as ORM;
+use Gedmo\Loggable\Entity\LogEntry;
+
+/**
+ * Bricks\SiteBundle\Entity\BrickLogEntry
+ *
+ * @ORM\Table("brick_log_entry")
+ * @ORM\Entity()
+ */
+class BrickLogEntry extends LogEntry
+{
+}

0 comments on commit 54872d8

Please sign in to comment.