Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[BC Break] Removed the entities from the bundle

The entities of the extensions themselves will be used.
  • Loading branch information...
commit a549c48b1853c84405b76fc0a4912d55a900a839 1 parent e237d8f
@stof authored
View
187 Document/AbstractLogEntry.php
@@ -1,187 +0,0 @@
-<?php
-
-namespace Stof\DoctrineExtensionsBundle\Document;
-
-/**
- *
- */
-abstract class AbstractLogEntry
-{
- /**
- * @var integer
- */
- protected $id;
-
- /**
- * @var string
- */
- protected $action;
-
- /**
- * @var \DateTime
- */
- protected $loggedAt;
-
- /**
- * @var string
- */
- protected $objectId;
-
- /**
- * @var string
- */
- protected $objectClass;
-
- /**
- * @var integer
- */
- protected $version;
-
- /**
- * @var string
- */
- protected $data;
-
- /**
- * @var string
- */
- protected $username;
-
- /**
- * Get action
- *
- * @return string
- */
- public function getAction()
- {
- return $this->action;
- }
-
- /**
- * Set action
- *
- * @param string $action
- */
- public function setAction($action)
- {
- $this->action = $action;
- }
-
- /**
- * Get object class
- *
- * @return string
- */
- public function getObjectClass()
- {
- return $this->objectClass;
- }
-
- /**
- * Set object class
- *
- * @param string $objectClass
- */
- public function setObjectClass($objectClass)
- {
- $this->objectClass = $objectClass;
- }
-
- /**
- * Get object id
- *
- * @return string
- */
- public function getObjectId()
- {
- return $this->objectId;
- }
-
- /**
- * Set object id
- *
- * @param string $objectId
- */
- public function setObjectId($objectId)
- {
- $this->objectId = $objectId;
- }
-
- /**
- * Get username
- *
- * @return string
- */
- public function getUsername()
- {
- return $this->username;
- }
-
- /**
- * Set username
- *
- * @param string $username
- */
- public function setUsername($username)
- {
- $this->username = $username;
- }
-
- /**
- * Get loggedAt
- *
- * @return \DateTime
- */
- public function getLoggedAt()
- {
- return $this->loggedAt;
- }
-
- /**
- * Set loggedAt
- */
- public function setLoggedAt()
- {
- $this->loggedAt = new \DateTime();
- }
-
- /**
- * Get data
- *
- * @return array or null
- */
- public function getData()
- {
- return $this->data;
- }
-
- /**
- * Set data
- *
- * @param array $data
- */
- public function setData($data)
- {
- $this->data = $data;
- }
-
- /**
- * Set current version
- *
- * @param integer $version
- */
- public function setVersion($version)
- {
- $this->version = $version;
- }
-
- /**
- * Get current version
- *
- * @return integer
- */
- public function getVersion()
- {
- return $this->version;
- }
-}
View
149 Document/AbstractTranslation.php
@@ -1,149 +0,0 @@
-<?php
-
-namespace Stof\DoctrineExtensionsBundle\Document;
-
-/**
- *
- */
-abstract class AbstractTranslation
-{
- /**
- * @var integer
- */
- protected $id;
-
- /**
- * @var string
- */
- protected $locale;
-
- /**
- * @var string
- */
- protected $objectClass;
-
- /**
- * @var string
- */
- protected $field;
-
- /**
- * @var string
- */
- protected $foreignKey;
-
- /**
- * @var string
- */
- protected $content;
-
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
-
- /**
- * Set locale
- *
- * @param string $locale
- */
- public function setLocale($locale)
- {
- $this->locale = $locale;
- }
-
- /**
- * Get locale
- *
- * @return string
- */
- public function getLocale()
- {
- return $this->locale;
- }
-
- /**
- * Set field
- *
- * @param string $field
- */
- public function setField($field)
- {
- $this->field = $field;
- }
-
- /**
- * Get field
- *
- * @return string
- */
- public function getField()
- {
- return $this->field;
- }
-
- /**
- * Set object class
- *
- * @param string $objectClass
- */
- public function setObjectClass($objectClass)
- {
- $this->objectClass = $objectClass;
- }
-
- /**
- * Get objectClass
- *
- * @return string
- */
- public function getObjectClass()
- {
- return $this->objectClass;
- }
-
- /**
- * Set foreignKey
- *
- * @param string $foreignKey
- */
- public function setForeignKey($foreignKey)
- {
- $this->foreignKey = $foreignKey;
- }
-
- /**
- * Get foreignKey
- *
- * @return string
- */
- public function getForeignKey()
- {
- return $this->foreignKey;
- }
-
- /**
- * Set content
- *
- * @param string $content
- */
- public function setContent($content)
- {
- $this->content = $content;
- }
-
- /**
- * Get content
- *
- * @return string
- */
- public function getContent()
- {
- return $this->content;
- }
-}
View
10 Document/LogEntry.php
@@ -1,10 +0,0 @@
-<?php
-
-namespace Stof\DoctrineExtensionsBundle\Document;
-
-/**
- * All required columns are mapped through inherited superclass
- */
-class LogEntry extends AbstractLogEntry
-{
-}
View
10 Document/Translation.php
@@ -1,10 +0,0 @@
-<?php
-
-namespace Stof\DoctrineExtensionsBundle\Document;
-
-/**
- * All required columns are mapped through inherited superclass
- */
-class Translation extends AbstractTranslation
-{
-}
View
107 Entity/AbstractClosure.php
@@ -1,107 +0,0 @@
-<?php
-
-namespace Stof\DoctrineExtensionsBundle\Entity;
-
-/**
- *
- */
-abstract class AbstractClosure
-{
- /**
- * @var integer
- */
- protected $id;
-
- /**
- * Mapped by listener
- * Visibility must be protected
- */
- protected $ancestor;
-
- /**
- * Mapped by listener
- * Visibility must be protected
- */
- protected $descendant;
-
- /**
- * @var integer
- */
- protected $depth;
-
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
-
- /**
- * Set ancestor
- *
- * @param object $ancestor
- * @return AbstractClosure
- */
- public function setAncestor($ancestor)
- {
- $this->ancestor = $ancestor;
- return $this;
- }
-
- /**
- * Get ancestor
- *
- * @return object
- */
- public function getAncestor()
- {
- return $this->ancestor;
- }
-
- /**
- * Set descendant
- *
- * @param object $descendant
- * @return AbstractClosure
- */
- public function setDescendant($descendant)
- {
- $this->descendant = $descendant;
- return $this;
- }
-
- /**
- * Get descendant
- *
- * @return object
- */
- public function getDescendant()
- {
- return $this->descendant;
- }
-
- /**
- * Set depth
- *
- * @param integer $depth
- * @return AbstractClosure
- */
- public function setDepth($depth)
- {
- $this->depth = $depth;
- return $this;
- }
-
- /**
- * Get depth
- *
- * @return integer
- */
- public function getDepth()
- {
- return $this->depth;
- }
-}
View
187 Entity/AbstractLogEntry.php
@@ -1,187 +0,0 @@
-<?php
-
-namespace Stof\DoctrineExtensionsBundle\Entity;
-
-/**
- *
- */
-abstract class AbstractLogEntry
-{
- /**
- * @var integer
- */
- protected $id;
-
- /**
- * @var string
- */
- protected $action;
-
- /**
- * @var \DateTime
- */
- protected $loggedAt;
-
- /**
- * @var string
- */
- protected $objectId;
-
- /**
- * @var string
- */
- protected $objectClass;
-
- /**
- * @var integer
- */
- protected $version;
-
- /**
- * @var array
- */
- protected $data;
-
- /**
- * @var string
- */
- protected $username;
-
- /**
- * Get action
- *
- * @return string
- */
- public function getAction()
- {
- return $this->action;
- }
-
- /**
- * Set action
- *
- * @param string $action
- */
- public function setAction($action)
- {
- $this->action = $action;
- }
-
- /**
- * Get object class
- *
- * @return string
- */
- public function getObjectClass()
- {
- return $this->objectClass;
- }
-
- /**
- * Set object class
- *
- * @param string $objectClass
- */
- public function setObjectClass($objectClass)
- {
- $this->objectClass = $objectClass;
- }
-
- /**
- * Get object id
- *
- * @return string
- */
- public function getObjectId()
- {
- return $this->objectId;
- }
-
- /**
- * Set object id
- *
- * @param string $objectId
- */
- public function setObjectId($objectId)
- {
- $this->objectId = $objectId;
- }
-
- /**
- * Get username
- *
- * @return string
- */
- public function getUsername()
- {
- return $this->username;
- }
-
- /**
- * Set username
- *
- * @param string $username
- */
- public function setUsername($username)
- {
- $this->username = $username;
- }
-
- /**
- * Get loggedAt
- *
- * @return \DateTime
- */
- public function getLoggedAt()
- {
- return $this->loggedAt;
- }
-
- /**
- * Set loggedAt
- */
- public function setLoggedAt()
- {
- $this->loggedAt = new \DateTime();
- }
-
- /**
- * Get data
- *
- * @return array or null
- */
- public function getData()
- {
- return $this->data;
- }
-
- /**
- * Set data
- *
- * @param array $data
- */
- public function setData($data)
- {
- $this->data = $data;
- }
-
- /**
- * Set current version
- *
- * @param integer $version
- */
- public function setVersion($version)
- {
- $this->version = $version;
- }
-
- /**
- * Get current version
- *
- * @return integer
- */
- public function getVersion()
- {
- return $this->version;
- }
-}
View
149 Entity/AbstractTranslation.php
@@ -1,149 +0,0 @@
-<?php
-
-namespace Stof\DoctrineExtensionsBundle\Entity;
-
-/**
- *
- */
-abstract class AbstractTranslation
-{
- /**
- * @var integer
- */
- protected $id;
-
- /**
- * @var string
- */
- protected $locale;
-
- /**
- * @var string
- */
- protected $objectClass;
-
- /**
- * @var string
- */
- protected $field;
-
- /**
- * @var string
- */
- protected $foreignKey;
-
- /**
- * @var string
- */
- protected $content;
-
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
-
- /**
- * Set locale
- *
- * @param string $locale
- */
- public function setLocale($locale)
- {
- $this->locale = $locale;
- }
-
- /**
- * Get locale
- *
- * @return string
- */
- public function getLocale()
- {
- return $this->locale;
- }
-
- /**
- * Set field
- *
- * @param string $field
- */
- public function setField($field)
- {
- $this->field = $field;
- }
-
- /**
- * Get field
- *
- * @return string
- */
- public function getField()
- {
- return $this->field;
- }
-
- /**
- * Set object class
- *
- * @param string $objectClass
- */
- public function setObjectClass($objectClass)
- {
- $this->objectClass = $objectClass;
- }
-
- /**
- * Get objectClass
- *
- * @return string
- */
- public function getObjectClass()
- {
- return $this->objectClass;
- }
-
- /**
- * Set foreignKey
- *
- * @param string $foreignKey
- */
- public function setForeignKey($foreignKey)
- {
- $this->foreignKey = $foreignKey;
- }
-
- /**
- * Get foreignKey
- *
- * @return string
- */
- public function getForeignKey()
- {
- return $this->foreignKey;
- }
-
- /**
- * Set content
- *
- * @param string $content
- */
- public function setContent($content)
- {
- $this->content = $content;
- }
-
- /**
- * Get content
- *
- * @return string
- */
- public function getContent()
- {
- return $this->content;
- }
-}
View
10 Entity/LogEntry.php
@@ -1,10 +0,0 @@
-<?php
-
-namespace Stof\DoctrineExtensionsBundle\Entity;
-
-/**
- * All required columns are mapped through inherited superclass
- */
-class LogEntry extends AbstractLogEntry
-{
-}
View
10 Entity/Translation.php
@@ -1,10 +0,0 @@
-<?php
-
-namespace Stof\DoctrineExtensionsBundle\Entity;
-
-/**
- * All required columns are mapped through inherited superclass
- */
-class Translation extends AbstractTranslation
-{
-}
View
14 Listener/LoggableListener.php
@@ -3,7 +3,6 @@
namespace Stof\DoctrineExtensionsBundle\Listener;
use Gedmo\Loggable\LoggableListener as BaseLoggableListener;
-use Gedmo\Loggable\Mapping\Event\LoggableAdapter;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
@@ -38,17 +37,4 @@ public function onKernelRequest(GetResponseEvent $event)
$this->setUsername($securityContext->getToken()->getUsername());
}
}
-
- protected function getLogEntryClass(LoggableAdapter $ea, $class)
- {
- $class = parent::getLogEntryClass($ea, $class);
-
- if ($class === 'Gedmo\\Loggable\\Entity\\LogEntry') {
- return 'Stof\\DoctrineExtensionsBundle\\Entity\\LogEntry';
- } elseif ($class === 'Gedmo\\Loggable\\Document\\LogEntry') {
- return 'Stof\\DoctrineExtensionsBundle\\Document\\LogEntry';
- }
-
- return $class;
- }
}
View
16 Listener/TranslationListener.php
@@ -2,8 +2,7 @@
namespace Stof\DoctrineExtensionsBundle\Listener;
-use Gedmo\Translatable\TranslationListener as BaseTranslationListener;
-use Gedmo\Translatable\Mapping\Event\TranslatableAdapter;
+use Gedmo\Translatable\TranslatableListener as BaseTranslationListener;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
/**
@@ -13,19 +12,6 @@
*/
class TranslationListener extends BaseTranslationListener
{
- public function getTranslationClass(TranslatableAdapter $ea, $class)
- {
- $class = parent::getTranslationClass($ea, $class);
-
- if ($class === 'Gedmo\\Translatable\\Entity\\Translation') {
- return 'Stof\\DoctrineExtensionsBundle\\Entity\\Translation';
- } elseif ($class === 'Gedmo\\Translatable\\Document\\Translation') {
- return 'Stof\\DoctrineExtensionsBundle\\Document\\Translation';
- }
-
- return $class;
- }
-
/**
* Set the translation listener locale from the request.
*
View
4 README.markdown
@@ -2,7 +2,7 @@ This bundle provides integration for
[DoctrineExtensions](http://github.com/l3pp4rd/DoctrineExtensions) in
your Symfony2 Project.
-For documentation, see:
+For documentation, see:
[`Resources/doc/index.rst`](https://github.com/stof/StofDoctrineExtensionsBundle/blob/master/Resources/doc/index.rst)
@@ -15,4 +15,4 @@ License:
>
> The master branch of the bundle is in sync with Symfony master branch which
> contains a BC break. If you are using a 2.0.x version of Symfony, you need
-> to use the 1.0.0 tag of the bundle.
+> to use the 1.0.x branch of the bundle.
View
17 Resources/config/doctrine/AbstractClosure.orm.xml
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
- http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
-
- <mapped-superclass name="Stof\DoctrineExtensionsBundle\Entity\AbstractClosure">
-
- <id name="id" type="integer">
- <generator strategy="IDENTITY" />
- </id>
-
- <field name="depth" type="integer" />
-
- </mapped-superclass>
-
-</doctrine-mapping>
View
27 Resources/config/doctrine/AbstractLogEntry.mongodb.xml
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping
- http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">
-
- <mapped-superclass name="Stof\DoctrineExtensionsBundle\Document\AbstractLogEntry">
-
- <field fieldName="id" id="true" />
-
- <field fieldName="action" type="string" />
-
- <field fieldName="loggedAt" type="date" index="true" />
-
- <field fieldName="objectId" type="string" nullable="true" />
-
- <field fieldName="objectClass" type="string" index="true" />
-
- <field fieldName="version" type="int" />
-
- <field fieldName="data" type="hash" nullable="true" />
-
- <field fieldName="username" type="string" nullable="true" index="true" />
-
- </mapped-superclass>
-
-</doctrine-mongo-mapping>
View
29 Resources/config/doctrine/AbstractLogEntry.orm.xml
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
- http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
-
- <mapped-superclass name="Stof\DoctrineExtensionsBundle\Entity\AbstractLogEntry">
-
- <id name="id" type="integer">
- <generator strategy="IDENTITY" />
- </id>
-
- <field name="action" type="string" length="8" />
-
- <field name="loggedAt" column="logged_at" type="datetime" />
-
- <field name="objectId" column="object_id" type="string" length="32" nullable="true" />
-
- <field name="objectClass" column="object_class" type="string" length="255" />
-
- <field name="version" type="integer" />
-
- <field name="data" type="array" nullable="true" />
-
- <field name="username" type="string" length="255" nullable="true" />
-
- </mapped-superclass>
-
-</doctrine-mapping>
View
23 Resources/config/doctrine/AbstractTranslation.mongodb.xml
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping
- http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">
-
- <mapped-superclass name="Stof\DoctrineExtensionsBundle\Document\AbstractTranslation">
-
- <field fieldName="id" id="true" />
-
- <field fieldName="locale" type="string" />
-
- <field fieldName="objectClass" name="object_class" type="string" />
-
- <field fieldName="field" type="string" />
-
- <field fieldName="foreignKey" name="foreign_key" type="string" />
-
- <field fieldName="content" type="string" />
-
- </mapped-superclass>
-
-</doctrine-mongo-mapping>
View
25 Resources/config/doctrine/AbstractTranslation.orm.xml
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
- http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
-
- <mapped-superclass name="Stof\DoctrineExtensionsBundle\Entity\AbstractTranslation">
-
- <id name="id" type="integer">
- <generator strategy="IDENTITY" />
- </id>
-
- <field name="locale" type="string" length="8" />
-
- <field name="objectClass" column="object_class" type="string" length="255" />
-
- <field name="field" type="string" length="32" />
-
- <field name="foreignKey" column="foreign_key" type="string" length="64" />
-
- <field name="content" type="text" nullable="true" />
-
- </mapped-superclass>
-
-</doctrine-mapping>
View
11 Resources/config/doctrine/LogEntry.mongodb.xml
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping
- http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">
-
- <document name="Stof\DoctrineExtensionsBundle\Document\LogEntry" repository-class="Gedmo\Loggable\Document\Repository\LogEntryRepository">
-
- </document>
-
-</doctrine-mongo-mapping>
View
17 Resources/config/doctrine/LogEntry.orm.xml
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
- http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
-
- <entity name="Stof\DoctrineExtensionsBundle\Entity\LogEntry" table="ext_log_entries" repository-class="Gedmo\Loggable\Entity\Repository\LogEntryRepository">
-
- <indexes>
- <index columns="object_class" name="log_class_lookup_idx" />
- <index columns="logged_at" name="log_date_lookup_idx" />
- <index columns="username" name="log_user_lookup_idx" />
- </indexes>
-
- </entity>
-
-</doctrine-mapping>
View
28 Resources/config/doctrine/Translation.mongodb.xml
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping
- http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">
-
- <document name="Stof\DoctrineExtensionsBundle\Document\Translation" repository-class="Gedmo\Translatable\Document\Repository\TranslationRepository">
-
- <indexes>
- <index>
- <option name="name" value="translations_lookup_idx" />
- <key name="locale" />
- <key name="object_class" />
- <key name="foreign_key" />
- </index>
- <index>
- <option name="name" value="lookup_unique_idx" />
- <option name="unique" value="true" />
- <key name="locale" />
- <key name="object_class" />
- <key name="foreign_key" />
- <key name="field" />
- </index>
- </indexes>
-
- </document>
-
-</doctrine-mongo-mapping>
View
19 Resources/config/doctrine/Translation.orm.xml
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
- http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
-
- <entity name="Stof\DoctrineExtensionsBundle\Entity\Translation" table="ext_translations" repository-class="Gedmo\Translatable\Entity\Repository\TranslationRepository">
-
- <indexes>
- <index columns="locale,object_class,foreign_key" name="translations_lookup_idx" />
- </indexes>
-
- <unique-constraints>
- <unique-constraint columns="locale,object_class,foreign_key,field" name="lookup_unique_idx" />
- </unique-constraints>
-
- </entity>
-
-</doctrine-mapping>
View
134 Resources/doc/index.rst
@@ -49,7 +49,7 @@ This can be done in two different ways:
[gedmo-doctrine-extensions]
git=http://github.com/l3pp4rd/DoctrineExtensions.git
- [DoctrineExtensionsBundle]
+ [StofDoctrineExtensionsBundle]
git=http://github.com/stof/StofDoctrineExtensionsBundle.git
target=/bundles/Stof/DoctrineExtensionsBundle
@@ -87,45 +87,55 @@ Add DoctrineExtensionsBundle to your application kernel
);
}
-Add DoctrineExtensionsBundle to your mapping
---------------------------------------------
+Add the extensions to your mapping
+----------------------------------
-.. note::
-
- This is not needed if you use the auto_mapping setting.
+Some of the extensions uses their own entities to do their work. You need
+to register their mapping in Doctrine when you want to use them.
-See the official documentation_ for details.
-
-for ORM::
+::
# app/config/config.yml
doctrine:
orm:
- mappings:
- StofDoctrineExtensionsBundle: ~
- # ... your others bundle
+ entity_managers:
+ default:
+ mappings:
+ gedmo_translatable:
+ type: annotation
+ prefix: Gedmo\Translatable\Entity
+ dir: "%kernel.root_dir%/../vendor/gedmo-doctrine-extensions/lib/Gedmo/Translatable/Entity"
+ alias: GedmoTranslatable # this one is optional and will default to the name set for the mapping
+ gedmo_translator:
+ type: annotation
+ prefix: Gedmo\Translator\Entity
+ dir: "%kernel.root_dir%/../vendor/gedmo-doctrine-extensions/lib/Gedmo/Translator/Entity"
+ alias: GedmoTranslator # this one is optional and will default to the name set for the mapping
+ 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
+ gedmo_tree:
+ type: annotation
+ prefix: Gedmo\Tree\Entity
+ dir: "%kernel.root_dir%/../vendor/gedmo-doctrine-extensions/lib/Gedmo/Tree/Entity"
+ alias: GedmoTree # this one is optional and will default to the name set for the mapping
-or for MongoDB ODM::
+.. note::
- # app/config/config.yml
- doctrine_mongodb:
- document_managers:
- default:
- mappings:
- StofDoctrineExtensionsBundle: ~
- # ... your others bundle
+ If you are using the short syntax for the ORM configuration, the `mappings`
+ key is directly under `orm:`
.. note::
- The mapping is only needed when using the ``Translatable`` or the
- ``Loggable`` behaviors. If you don't use any of them, you can disable
- it to avoid creating the tables even when using auto_mapping::
+ If you are using several entity managers, take care to register the entities
+ for the right ones.
- doctrine:
- orm:
- auto_mapping: true
- mappings:
- StofDoctrineExtensionsBundle: false
+.. note::
+
+ The mapping for MongoDB is similar. The ODM documents are in the `Document`
+ subnamespace of each extension instead of `Entity`.
Configure the bundle
====================
@@ -212,71 +222,6 @@ Use the DoctrineExtensions library
All explanations about this library are available on the official blog_
-As bundle uses the new annotation implementation (as all Symfony2 code)
-the annotations are a bit different.
-
-Instead of::
-
- /**
- * @gedmo:Tree
- */
-
-use::
-
- use Gedmo\Mapping\Annotation as Gedmo;
- /**
- * @Gedmo\Tree
- */
-
-This applies for all annotations of the library.
-
-The default entity for translations is
-``Stof\DoctrineExtensionsBundle\Entity\Translation``. The default
-document is ``Stof\DoctrineExtensionsBundle\Document\Translation``.
-
-Creating your own translation entity
-------------------------------------
-
-When you have a great number of entries for an entity you should create
-a dedicated translation entity to have good performances. The only
-difference when using it with Symfony2 is the mapped-superclass to use.
-
-The simplest way to do it is to copy the default translation entity
-and just change the namespace and the class name.
-
-Here is an example for the ORM::
-
- // src/Application/MyBundle/Entity/MyTranslationEntity.php
-
- namespace Application\MyBundle\Entity;
-
- use Stof\DoctrineExtensionsBundle\Entity\AbstractTranslation;
- use Doctrine\ORM\Mapping as ORM;
-
- /**
- * Application\MyBundle\Entity\MyTranslationEntity
- *
- * @ORM\Entity(repositoryClass="Gedmo\Translatable\Entity\Repository\TranslationRepository")
- * @ORM\Table(
- * name="ext_translations",
- * indexes={@ORM\index(name="translations_lookup_idx", columns={
- * "locale", "object_class", "foreign_key"
- * })},
- * uniqueConstraints={@ORM\UniqueConstraint(name="lookup_unique_idx", columns={
- * "locale", "object_class", "foreign_key", "field"
- * })}
- * )
- */
- class TranslationEntity extends AbstractTranslation
- {
- }
-
-Same is doable for the ODM.
-
-You can also create your own repositoryClass by extending
-``Gedmo\Translatable\Entity\Repository\TranslationRepository`` or
-``Gedmo\Translatable\Document\Repository\TranslationRepository``
-
Advanced use
============
@@ -311,5 +256,4 @@ or in XML::
</container>
.. _DoctrineExtensions: http://github.com/l3pp4rd/DoctrineExtensions
-.. _blog: http://gediminasm.org/articles
-.. _documentation: http://symfony.com/doc/current/reference/configuration/doctrine.html#configuration-overview
+.. _blog: http://gediminasm.org/
View
17 Upgrade_to_1_1.md
@@ -0,0 +1,17 @@
+Upgrading from 1.0 to 1.1
+=========================
+
+This file describes the needed changes when upgrading from 1.0 to 1.1
+
+### Bumped the requirements
+
+The bundle now requires Symfony 2.1 and the 2.3 version of the Gedmo extensions
+(which is the master branch at the time of this writing)
+
+### Removed the duplicated entities.
+
+The bundle no longer duplicates the entities provided by the extensions
+to make the maintenance easier. You need to configure the mapping explicitly
+for the extensions as DoctrineBundle cannot guess it.
+See the updated documentation about registering the mapping for the way to
+register them.
Please sign in to comment.
Something went wrong with that request. Please try again.