Преглед изворни кода

Make the bundle parent optional

Thomas Rabaix пре 14 година
родитељ
комит
374b9397f2
2 измењених фајлова са 19 додато и 1 уклоњено
  1. 9 1
      README.md
  2. 10 0
      SonataUserBundle.php

+ 9 - 1
README.md

@@ -1,4 +1,12 @@
 # Integrate the FOS/UserBundle into the Sonata Project
 
     - AdminBundle : add user and group management
-    - EasyExtends : allows to generate Application level model
+    - EasyExtends : allows to generate Application level model
+
+
+# Installation
+
+    you have 2 otpions to initialize the SonataUserBundle, you can select which bundle SonataUserBundle extends
+
+        - new Sonata\UserBundle\SonataUserBundle('FOSUserBundle') : the bundle will extends ``FOSUserBundle``
+        - new Sonata\UserBundle\SonataUserBundle() : the bundle will NOT extends ``FOSUserBundle``

+ 10 - 0
SonataUserBundle.php

@@ -15,5 +15,15 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
 
 class SonataUserBundle extends Bundle
 {
+    protected $parent;
 
+    public function __construct($parent = null)
+    {
+        $this->parent = $parent;
+    }
+
+    public function getParent()
+    {
+        return $this->parent;
+    }
 }