浏览代码

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;
+    }
 }