Author: Leon.van.der.Ree
Date: 2010-03-25 09:52:43 +0100 (Thu, 25 Mar 2010)
New Revision: 28778

Modified:
   
plugins/sfGridPlugin/trunk/lib/grid/formatter/html/sfGridFormatterHtml.class.php
   
plugins/sfGridPlugin/trunk/lib/grid/formatter/html/sfGridFormatterHtmlRow.class.php
   
plugins/sfGridPlugin/trunk/lib/grid/formatter/json/sfGridFormatterJson.class.php
   
plugins/sfGridPlugin/trunk/lib/grid/formatter/json/sfGridFormatterJsonRow.class.php
   
plugins/sfGridPlugin/trunk/lib/grid/formatter/sfGridFormatterDynamic.class.php
   plugins/sfGridPlugin/trunk/lib/grid/formatter/sfGridFormatterInterface.php
   plugins/sfGridPlugin/trunk/test/unit/grid/sfGridFormatterHtmlRowTest.php
Log:
further updated interfaces

Modified: 
plugins/sfGridPlugin/trunk/lib/grid/formatter/html/sfGridFormatterHtml.class.php
===================================================================
--- 
plugins/sfGridPlugin/trunk/lib/grid/formatter/html/sfGridFormatterHtml.class.php
    2010-03-25 08:36:30 UTC (rev 28777)
+++ 
plugins/sfGridPlugin/trunk/lib/grid/formatter/html/sfGridFormatterHtml.class.php
    2010-03-25 08:52:43 UTC (rev 28778)
@@ -42,9 +42,7 @@
    */
   public function __construct(sfGrid $grid)
   {
-    parent::__construct($grid);
-
-    $this->row = new sfGridFormatterHtmlRow($grid, 0);
+    parent::__construct($grid, new sfGridFormatterHtmlRow($grid, 0));
   }
 
   /**
@@ -92,7 +90,10 @@
    */
   public function render()
   {
-    return $this->renderHead().$this->renderFoot().$this->renderBody();
+    return 
+      $this->renderHead().
+      $this->renderFoot().
+      $this->renderBody();
   }
 
   /**

Modified: 
plugins/sfGridPlugin/trunk/lib/grid/formatter/html/sfGridFormatterHtmlRow.class.php
===================================================================
--- 
plugins/sfGridPlugin/trunk/lib/grid/formatter/html/sfGridFormatterHtmlRow.class.php
 2010-03-25 08:36:30 UTC (rev 28777)
+++ 
plugins/sfGridPlugin/trunk/lib/grid/formatter/html/sfGridFormatterHtmlRow.class.php
 2010-03-25 08:52:43 UTC (rev 28778)
@@ -49,16 +49,6 @@
   }
 
   /**
-   * Returns the associated grid
-   *
-   * @return sfGrid
-   */
-  public function getGrid()
-  {
-    return $this->grid;
-  }
-
-  /**
    * Renders a row to html
    *
    * @return string

Modified: 
plugins/sfGridPlugin/trunk/lib/grid/formatter/json/sfGridFormatterJson.class.php
===================================================================
--- 
plugins/sfGridPlugin/trunk/lib/grid/formatter/json/sfGridFormatterJson.class.php
    2010-03-25 08:36:30 UTC (rev 28777)
+++ 
plugins/sfGridPlugin/trunk/lib/grid/formatter/json/sfGridFormatterJson.class.php
    2010-03-25 08:52:43 UTC (rev 28778)
@@ -17,9 +17,7 @@
    */
   public function __construct(sfGrid $grid)
   {
-    parent::__construct($grid);
-
-    $this->row = new sfGridFormatterJsonRow($grid, 0);
+    parent::__construct($grid, new sfGridFormatterJsonRow($grid, 0));
   }
   
   /**

Modified: 
plugins/sfGridPlugin/trunk/lib/grid/formatter/json/sfGridFormatterJsonRow.class.php
===================================================================
--- 
plugins/sfGridPlugin/trunk/lib/grid/formatter/json/sfGridFormatterJsonRow.class.php
 2010-03-25 08:36:30 UTC (rev 28777)
+++ 
plugins/sfGridPlugin/trunk/lib/grid/formatter/json/sfGridFormatterJsonRow.class.php
 2010-03-25 08:52:43 UTC (rev 28778)
@@ -16,16 +16,6 @@
 {
 
   /**
-   * Returns the associated grid
-   *
-   * @return sfGrid
-   */
-  public function getGrid()
-  {
-    return $this->grid;
-  }
-
-  /**
    * Renders a row to an array
    *
    * @return string

Modified: 
plugins/sfGridPlugin/trunk/lib/grid/formatter/sfGridFormatterDynamic.class.php
===================================================================
--- 
plugins/sfGridPlugin/trunk/lib/grid/formatter/sfGridFormatterDynamic.class.php  
    2010-03-25 08:36:30 UTC (rev 28777)
+++ 
plugins/sfGridPlugin/trunk/lib/grid/formatter/sfGridFormatterDynamic.class.php  
    2010-03-25 08:52:43 UTC (rev 28778)
@@ -41,12 +41,12 @@
    * constructor of a Grid Formatter
    * 
    * @param sfGrid $grid
+   * @param sfGridFormatterRowInterface $rowFormatter
    */
-  public function __construct(sfGrid $grid)
+  public function __construct(sfGrid $grid, sfGridFormatterRowInterface 
$rowFormatter)
   {
     $this->grid = $grid;
-
-//    $this->row = new sfGridFormatter * Row($grid, 0);
+    $this->row = $rowFormatter;
   }
     
 

Modified: 
plugins/sfGridPlugin/trunk/lib/grid/formatter/sfGridFormatterInterface.php
===================================================================
--- plugins/sfGridPlugin/trunk/lib/grid/formatter/sfGridFormatterInterface.php  
2010-03-25 08:36:30 UTC (rev 28777)
+++ plugins/sfGridPlugin/trunk/lib/grid/formatter/sfGridFormatterInterface.php  
2010-03-25 08:52:43 UTC (rev 28778)
@@ -19,13 +19,6 @@
 interface sfGridFormatterInterface
 {
   /**
-   * constructor of a Grid Formatter
-   * 
-   * @param sfGrid $grid
-   */
-  public function __construct(sfGrid $grid);
-  
-  /**
    * Renders the grid
    * 
    * @return string

Modified: 
plugins/sfGridPlugin/trunk/test/unit/grid/sfGridFormatterHtmlRowTest.php
===================================================================
--- plugins/sfGridPlugin/trunk/test/unit/grid/sfGridFormatterHtmlRowTest.php    
2010-03-25 08:36:30 UTC (rev 28777)
+++ plugins/sfGridPlugin/trunk/test/unit/grid/sfGridFormatterHtmlRowTest.php    
2010-03-25 08:52:43 UTC (rev 28778)
@@ -12,13 +12,12 @@
 require_once(dirname(__FILE__).'/../mock/sfGridMock.class.php');
 require_once(dirname(__FILE__).'/../mock/sfWidgetMock.class.php');
 
-$t = new lime_test(11, new lime_output_color());
+$t = new lime_test(9, new lime_output_color());
 
 // ->__construct()
 $t->diag('->__construct()');
 $grid = new sfGridMock();
 $f = new sfGridFormatterHtmlRow($grid, 1);
-$t->is($f->getGrid(), $grid, '__construct() initializes the formatter');
 $t->is($f->getIndex(), 1, '__construct() initializes the formatter');
 
 // We don't throw out of bound exceptions anymore, we do this lazy
@@ -38,7 +37,6 @@
 
 $grid = new sfGridMock();
 $f->initialize($grid, 1);
-$t->is($f->getGrid(), $grid, 'initialize() initializes the formatter');
 $t->is($f->getIndex(), 1, 'initialize() initializes the formatter');
 
 // We don't throw out of bound exceptions anymore, we do this lazy

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to