[Solar-svn] Revision 3178

pmjones at solarphp.com pmjones at solarphp.com
Tue May 27 11:37:10 CDT 2008


Solar_Sql_Model_Record:

* [CHG] Now uses $related fetchObject() instead of $model fetchRelatedObject().

* [DEL] Methods getRelatedPage() and setRelatedPage(), as these are never actually called from anywhere, and do not have the necessary support in Solar_Sql_Model.


Modified: trunk/Solar/Sql/Model/Record.php
===================================================================
--- trunk/Solar/Sql/Model/Record.php	2008-05-27 16:35:34 UTC (rev 3177)
+++ trunk/Solar/Sql/Model/Record.php	2008-05-27 16:37:10 UTC (rev 3178)
@@ -146,9 +146,9 @@
             // the key was for a relation that has no data yet.
             // load the data.  don't return at this point, look
             // for accessor methods later.
-            $this->_data[$key] = $this->_model->fetchRelatedObject(
+            $related = $this->_model->getRelated($key);
+            $this->_data[$key] = $related->fetchObject(
                 $this,
-                $key,
                 $this->_related_page[$key]
             );
         }
@@ -1155,55 +1155,6 @@
     
     // -----------------------------------------------------------------
     //
-    // Record relationships
-    //
-    // -----------------------------------------------------------------
-    
-    /**
-     * 
-     * Returns the current page number for a named relation.
-     * 
-     * @param string $name The relationship name.
-     * 
-     * @return int
-     * 
-     */
-    public function getRelatedPage($name)
-    {
-        $this->_checkDeleted();
-        
-        if (array_key_exists($name, $this->_data)) {
-            return $this->_model->related_page[$name];
-        }
-    }
-    
-    /**
-     * 
-     * Sets the page number for a named relation, so that only records from
-     * that page are loaded.
-     * 
-     * Resets the loaded records to NULL so that the new records are lazy-
-     * loaded on demand.
-     * 
-     * @param string $name The relationship name.
-     * 
-     * @param int $page The page number of records to load.
-     * 
-     * @return void
-     * 
-     */
-    public function setRelatedPage($name, $page)
-    {
-        $this->_checkDeleted();
-        
-        if (array_key_exists($name, $this->_data)) {
-            $this->_model->related_page[$name] = (int) $page;
-            $this->_data[$name] = null;
-        }
-    }
-    
-    // -----------------------------------------------------------------
-    //
     // Record status
     //
     // -----------------------------------------------------------------




More information about the Solar-svn mailing list