Procházet zdrojové kódy

Make the bundle parent optional

Thomas Rabaix před 14 roky
rodič
revize
374b9397f2
2 změnil soubory, kde provedl 19 přidání a 1 odebrání
  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
 # Integrate the FOS/UserBundle into the Sonata Project
 
 
     - AdminBundle : add user and group management
     - 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
 class SonataUserBundle extends Bundle
 {
 {
+    protected $parent;
 
 
+    public function __construct($parent = null)
+    {
+        $this->parent = $parent;
+    }
+
+    public function getParent()
+    {
+        return $this->parent;
+    }
 }
 }