Jelajahi Sumber

Fix post merge issues and more BC work

Tom Adam 13 tahun lalu
induk
melakukan
f80e6b8deb

+ 23 - 28
Form/EventListener/FormProxy.php

@@ -4,7 +4,7 @@ namespace Sonata\AdminBundle\Form\EventListener;
 
 use Symfony\Component\Form\FormInterface;
 use Symfony\Component\Form\FormError;
-use Symfony\Component\Form\FormView;
+use Symfony\Component\Form\FormViewInterface;
 
 class FormProxy implements \IteratorAggregate, FormInterface
 {
@@ -68,6 +68,11 @@ class FormProxy implements \IteratorAggregate, FormInterface
         return $this->__call('add', func_get_args());
     }
 
+    public function get($name)
+    {
+        return $this->__call('get', func_get_args());
+    }
+
     public function has($name)
     {
         return $this->__call('has', func_get_args());
@@ -78,17 +83,12 @@ class FormProxy implements \IteratorAggregate, FormInterface
         return $this->__call('remove', func_get_args());
     }
 
-    public function getChildren()
-    {
-        return $this->__call('getChildren', func_get_args());
-    }
-
-    public function hasChildren()
+    public function all()
     {
-        return $this->__call('hasChildren', func_get_args());
+        return $this->__call('all', func_get_args());
     }
 
-    public function setData($appData)
+    public function setData($modelData)
     {
         return $this->__call('setData', func_get_args());
     }
@@ -103,9 +103,9 @@ class FormProxy implements \IteratorAggregate, FormInterface
         return $this->__call('getNormData', func_get_args());
     }
 
-    public function getClientData()
+    public function getViewData()
     {
-        return $this->__call('getClientData', func_get_args());
+        return $this->__call('getViewData', func_get_args());
     }
 
     public function getExtraData()
@@ -113,14 +113,14 @@ class FormProxy implements \IteratorAggregate, FormInterface
         return $this->__call('getExtraData', func_get_args());
     }
 
-    public function isBound()
+    public function getConfig()
     {
-        return $this->__call('isBound', func_get_args());
+        return $this->__call('getConfig', func_get_args());
     }
 
-    public function getTypes()
+    public function isBound()
     {
-        return $this->__call('getTypes', func_get_args());
+        return $this->__call('isBound', func_get_args());
     }
 
     public function getName()
@@ -128,6 +128,11 @@ class FormProxy implements \IteratorAggregate, FormInterface
         return $this->__call('getName', func_get_args());
     }
 
+    public function getPropertyPath()
+    {
+        return $this->__call('getPropertyPath', func_get_args());
+    }
+
     public function addError(FormError $error)
     {
         return $this->__call('addError', func_get_args());
@@ -138,9 +143,9 @@ class FormProxy implements \IteratorAggregate, FormInterface
         return $this->__call('isRequired', func_get_args());
     }
 
-    public function isReadOnly()
+    public function isDisabled()
     {
-        return $this->__call('isReadOnly', func_get_args());
+        return $this->__call('isDisabled', func_get_args());
     }
 
     public function isEmpty()
@@ -158,16 +163,6 @@ class FormProxy implements \IteratorAggregate, FormInterface
         return $this->__call('bind', func_get_args());
     }
 
-    public function hasAttribute($name)
-    {
-        return $this->__call('hasAttribute', func_get_args());
-    }
-
-    public function getAttribute($name)
-    {
-        return $this->__call('getAttribute', func_get_args());
-    }
-
     public function getRoot()
     {
         return $this->__call('getRoot', func_get_args());
@@ -178,7 +173,7 @@ class FormProxy implements \IteratorAggregate, FormInterface
         return $this->__call('isRoot', func_get_args());
     }
 
-    public function createView(FormView $parent = null)
+    public function createView(FormViewInterface $parent = null)
     {
         return $this->__call('createView', func_get_args());
     }

+ 2 - 2
Form/EventListener/MergeCollectionListener.php

@@ -35,13 +35,13 @@ class MergeCollectionListener implements EventSubscriberInterface
      */
     public static function getSubscribedEvents()
     {
-        return array(FormEvents::BIND_NORM_DATA => 'onBindNormData');
+        return array(FormEvents::BIND => 'onBind');
     }
 
     /**
      * @param \Symfony\Component\Form\Event\FilterDataEvent $event
      */
-    public function onBindNormData(FilterDataEvent $event)
+    public function onBind(FilterDataEvent $event)
     {
         $collection = $event->getForm()->getData();
         $data       = $event->getData();

+ 3 - 3
Form/EventListener/ResizeFormListener.php

@@ -66,7 +66,7 @@ class ResizeFormListener implements EventSubscriberInterface
         return array(
             FormEvents::PRE_SET_DATA    => 'preSetData',
             FormEvents::PRE_BIND        => 'preBind',
-            FormEvents::BIND_NORM_DATA  => 'onBindNormData',
+            FormEvents::BIND            => 'onBind',
         );
     }
 
@@ -138,7 +138,7 @@ class ResizeFormListener implements EventSubscriberInterface
                     'property_path' => '[' . $name . ']',
                 ));
 
-                $form->add(new FormProxy($this->factory->createNamed($this->type, $name, null, $options), isset($value['_delete'])));
+                $form->add(new FormProxy($this->factory->createNamed($name, $this->type, null, $options), isset($value['_delete'])));
             }
 
             if (isset($value['_delete'])) {
@@ -153,7 +153,7 @@ class ResizeFormListener implements EventSubscriberInterface
      * @return mixed
      * @throws \Symfony\Component\Form\Exception\UnexpectedTypeException
      */
-    public function onBindNormData(FilterDataEvent $event)
+    public function onBind(FilterDataEvent $event)
     {
         if (!$this->resizeOnBind) {
             return;

+ 2 - 13
composer.json

@@ -18,24 +18,13 @@
     ],
     "require": {
         "php": ">=5.3.2",
-<<<<<<< HEAD
         "symfony/symfony": "2.1.*",
-        "jms/translation-bundle": "dev-master",
+        "symfony/framework-bundle": "2.1.*",
+        "symfony/security-bundle": "2.1.*",
         "knplabs/knp-menu-bundle": "1.1.*",
         "sonata-project/jquery-bundle": "dev-master",
         "sonata-project/exporter": "dev-master",
         "sonata-project/block-bundle": "dev-master"
-=======
-
-        "symfony/symfony": "2.0.*",
-
-        "symfony/framework-bundle": "2.0.*",
-        "symfony/security-bundle": "2.0.*",
-        "knplabs/knp-menu-bundle": "1.1.*",
-        "sonata-project/jquery-bundle": "master-dev",
-        "sonata-project/exporter": "master-dev",
-        "sonata-project/block-bundle": "2.0.*"
->>>>>>> origin/2.0
     },
     "require-dev": {
         "jms/translation-bundle": "*"