Browse Source

Sortable documentation

Lukas Botsch 14 years ago
parent
commit
8fefe94b1c
1 changed files with 0 additions and 85 deletions
  1. 0 85
      doc/sortable.md

+ 0 - 85
doc/sortable.md

@@ -31,7 +31,6 @@ Content:
 - [Yaml](#yaml) mapping example
 - [Xml](#xml) mapping example
 - Basic usage [examples](#basic-examples)
-- Advanced usage [examples](#advanced-examples)
 
 
 ## Setup and autoloading {#including-extension}
@@ -279,87 +278,3 @@ Yaml mapped Item: **/mapping/yaml/Entity.Item.dcm.yml**
     // 0: item 2
     // 1: item 1
 
-## Advanced examples: {#advanced-examples}
-
-### Using TranslationListener to translate our slug
-
-If you want to attach **TranslationListener** also add it to EventManager after
-the **SluggableListener**. It is important because slug must be generated first
-before the creation of it`s translation.
-
-    $evm = new \Doctrine\Common\EventManager();
-    $sluggableListener = new \Gedmo\Sluggable\SluggableListener();
-    $evm->addEventSubscriber($sluggableListener);
-    $translatableListener = new \Gedmo\Translatable\TranslationListener();
-    $translatableListener->setTranslatableLocale('en_us');
-    $evm->addEventSubscriber($translatableListener);
-    // now this event manager should be passed to entity manager constructor
-
-And the Entity should look like:
-
-    namespace Entity;
-    
-    /**
-     * @Table(name="articles")
-     * @Entity
-     */
-    class Article
-    {
-        /** @Id @GeneratedValue @Column(type="integer") */
-        private $id;
-    
-        /**
-         * @gedmo:Translatable
-         * @gedmo:Sluggable
-         * @Column(name="title", type="string", length=64)
-         */
-        private $title;
-    
-        /**
-         * @gedmo:Translatable
-         * @gedmo:Sluggable
-         * @Column(name="code", type="string", length=16)
-         */
-        private $code;
-    
-        /**
-         * @gedmo:Translatable
-         * @gedmo:Slug
-         * @Column(name="slug", type="string", length=128, unique=true)
-         */
-        private $slug;
-    
-        public function getId()
-        {
-            return $this->id;
-        }
-    
-        public function setTitle($title)
-        {
-            $this->title = $title;
-        }
-    
-        public function getTitle()
-        {
-            return $this->title;
-        }
-    
-        public function setCode($code)
-        {
-            $this->code = $code;
-        }
-    
-        public function getCode()
-        {
-            return $this->code;
-        }
-    
-        public function getSlug()
-        {
-            return $this->slug;
-        }
-    }
-
-Now the generated slug will be translated by Translatable behavior
-
-Easy like that, any suggestions on improvements are very welcome