[Solar-svn] Revision 2727

pmjones at solarphp.com pmjones at solarphp.com
Tue Aug 21 10:18:03 CDT 2007


Branch: Solar_Model_*: [FIX] Renamed all _addRelated() calls to _belongsTo(), _hasOne(), and _hasMany().




Modified: branches/orm/Solar/Model/Areas.php
===================================================================
--- branches/orm/Solar/Model/Areas.php	2007-08-21 15:16:35 UTC (rev 2726)
+++ branches/orm/Solar/Model/Areas.php	2007-08-21 15:18:03 UTC (rev 2727)
@@ -51,7 +51,7 @@
         /**
          * Relationships.
          */
-        $this->_addRelated('has_many', 'nodes', array(
+        $this->_hasMany('nodes', array(
             'foreign_model' => 'nodes',
             'foreign_key'   => 'parent_id',
         ));

Modified: branches/orm/Solar/Model/Nodes/Blogs.php
===================================================================
--- branches/orm/Solar/Model/Nodes/Blogs.php	2007-08-21 15:16:35 UTC (rev 2726)
+++ branches/orm/Solar/Model/Nodes/Blogs.php	2007-08-21 15:18:03 UTC (rev 2727)
@@ -8,12 +8,12 @@
          * Relationships.
          */
         
-        $this->_addRelated('belongs_to', 'area', array(
+        $this->_belongsTo('area', array(
             'foreign_model' => 'areas',
             'foreign_key'   => 'area_id',
         ));
         
-        $this->_addRelated('has_many', 'comments', array(
+        $this->_hasMany('comments', array(
             'foreign_model' => 'comments',
             'foreign_key'   => 'parent_id',
         ));

Modified: branches/orm/Solar/Model/Nodes/Comments.php
===================================================================
--- branches/orm/Solar/Model/Nodes/Comments.php	2007-08-21 15:16:35 UTC (rev 2726)
+++ branches/orm/Solar/Model/Nodes/Comments.php	2007-08-21 15:18:03 UTC (rev 2727)
@@ -3,7 +3,7 @@
     protected function _setup()
     {
         parent::_setup();
-        $this->_addRelated('belongs_to', 'node', array(
+        $this->_belongsTo('node', array(
             'foreign_model' => 'nodes',
             'foreign_key'   => 'parent_id', // normally node_id
         ));

Modified: branches/orm/Solar/Model/Nodes/Revisions.php
===================================================================
--- branches/orm/Solar/Model/Nodes/Revisions.php	2007-08-21 15:16:35 UTC (rev 2726)
+++ branches/orm/Solar/Model/Nodes/Revisions.php	2007-08-21 15:18:03 UTC (rev 2727)
@@ -8,7 +8,7 @@
         /**
          * Relationships.
          */
-        $this->_addRelated('belongs_to', 'node', array(
+        $this->_belongsTo('node', array(
             'foreign_model' => 'node',
             'foreign_key'   => 'parent_id',
         ));

Modified: branches/orm/Solar/Model/Nodes/Wikis.php
===================================================================
--- branches/orm/Solar/Model/Nodes/Wikis.php	2007-08-21 15:16:35 UTC (rev 2726)
+++ branches/orm/Solar/Model/Nodes/Wikis.php	2007-08-21 15:18:03 UTC (rev 2727)
@@ -7,13 +7,13 @@
         /**
          * Relationships.
          */
-        $this->_addRelated('has_many', 'revisions', array(
+        $this->_hasMany('revisions', array(
             'foreign_model' => 'revision',
             'foreign_key'   => 'parent_id',
             'order'         => 'id DESC',
         ));
         
-        $this->_addRelated('has_many', 'comments', array(
+        $this->_hasMany('comments', array(
             'foreign_model' => 'comment',
             'foreign_key'   => 'parent_id',
         ));

Modified: branches/orm/Solar/Model/Nodes.php
===================================================================
--- branches/orm/Solar/Model/Nodes.php	2007-08-21 15:16:35 UTC (rev 2726)
+++ branches/orm/Solar/Model/Nodes.php	2007-08-21 15:18:03 UTC (rev 2727)
@@ -126,18 +126,18 @@
         /**
          * Relationships.
          */
-        $this->_addRelated('belongs_to', 'area', array(
+        $this->_belongsTo('area', array(
             'foreign_model' => 'areas',
             'foreign_key'   => 'area_id',
             'eager'         => false,
         ));
         
-        $this->_addRelated('has_many', 'taggings', array(
+        $this->_hasMany('taggings', array(
             'foreign_model' => 'taggings',
             'foreign_key'   => 'node_id',
         ));
         
-        $this->_addRelated('has_many', 'tags', array(
+        $this->_hasMany('tags', array(
             'foreign_model' => 'tags',
             'through'       => 'taggings',
             'through_key'   => 'tag_id',

Modified: branches/orm/Solar/Model/Taggings.php
===================================================================
--- branches/orm/Solar/Model/Taggings.php	2007-08-21 15:16:35 UTC (rev 2726)
+++ branches/orm/Solar/Model/Taggings.php	2007-08-21 15:18:03 UTC (rev 2727)
@@ -15,12 +15,12 @@
             'tag_id'  => 'int',
         );
         
-        $this->_addRelated('belongs_to', 'node', array(
+        $this->_belongsTo('node', array(
             'foreign_model' => 'nodes',
             'foreign_key'   => 'node_id',
         ));
         
-        $this->_addRelated('belongs_to', 'tag', array(
+        $this->_belongsTo('tag', array(
             'foreign_model' => 'tags',
             'foreign_key'   => 'tag_id',
         ));

Modified: branches/orm/Solar/Model/Tags.php
===================================================================
--- branches/orm/Solar/Model/Tags.php	2007-08-21 15:16:35 UTC (rev 2726)
+++ branches/orm/Solar/Model/Tags.php	2007-08-21 15:18:03 UTC (rev 2727)
@@ -37,12 +37,12 @@
         /**
          * Relationships.
          */
-        $this->_addRelated('has_many', 'taggings', array(
+        $this->_hasMany('taggings', array(
             'foreign_model' => 'taggings',
             'foreign_key'   => 'tag_id',
         ));
         
-        $this->_addRelated('has_many', 'nodes', array(
+        $this->_hasMany('nodes', array(
             'foreign_model' => 'nodes',
             'through'       => 'taggings',
         ));




More information about the Solar-svn mailing list