Browse Source

Fix methods call

Thomas Rabaix 13 years ago
parent
commit
4c9a6a0ec4
3 changed files with 17 additions and 3 deletions
  1. 8 0
      Datagrid/Datagrid.php
  2. 6 0
      Datagrid/DatagridInterface.php
  3. 3 3
      Datagrid/DatagridMapper.php

+ 8 - 0
Datagrid/Datagrid.php

@@ -134,6 +134,14 @@ class Datagrid implements DatagridInterface
         return isset($this->filters[$name]);
     }
 
+    /**
+     * @param $name
+     */
+    public function removeFilter($name)
+    {
+        unset($this->filters[$name]);
+    }
+
     /**
      * @param $name
      * @return null

+ 6 - 0
Datagrid/DatagridInterface.php

@@ -90,4 +90,10 @@ interface DatagridInterface
      * @return bool
      */
     function hasFilter($name);
+
+    /**
+     * @abstract
+     * @param $name
+     */
+    function removeFilter($name);
 }

+ 3 - 3
Datagrid/DatagridMapper.php

@@ -87,7 +87,7 @@ class DatagridMapper
      */
     public function get($name)
     {
-        return $this->datagrid->get($name);
+        return $this->datagrid->getFilter($name);
     }
 
     /**
@@ -96,7 +96,7 @@ class DatagridMapper
      */
     public function has($key)
     {
-        return $this->datagrid->has($key);
+        return $this->datagrid->hasFilter($key);
     }
 
     /**
@@ -106,7 +106,7 @@ class DatagridMapper
     public function remove($key)
     {
         $this->admin->removeFilterFieldDescription($key);
-        $this->datagrid->remove($key);
+        $this->datagrid->removeFilter($key);
 
         return $this;
     }