Author: guilhermeblanco
Date: 2008-08-27 03:45:11 +0100 (Wed, 27 Aug 2008)
New Revision: 4830

Modified:
   branches/1.0/lib/Doctrine/Import/Builder.php
   branches/1.0/lib/Doctrine/Record/Abstract.php
   branches/1.0/lib/Doctrine/Relation.php
   branches/1.0/tests/RecordTestCase.php
   branches/1.0/tests/TableTestCase.php
Log:
Removed Doctrine_Relation::ONE_AGGREGATE, Doctrine_Relation::ONE_AGGREGATE in 
favor of a single one Doctrine_Relation::ONE.
Removed Doctrine_Relation::MANY_AGGREGATE, Doctrine_Relation::MANY_AGGREGATE in 
favor of a single one Doctrine_Relation::MANY.
Finished removal of ownsOne and ownsMany.

Modified: branches/1.0/lib/Doctrine/Import/Builder.php
===================================================================
--- branches/1.0/lib/Doctrine/Import/Builder.php        2008-08-27 02:30:02 UTC 
(rev 4829)
+++ branches/1.0/lib/Doctrine/Import/Builder.php        2008-08-27 02:45:11 UTC 
(rev 4830)
@@ -439,8 +439,7 @@
                     $relation['type'] = Doctrine_Relation::ONE;
                 }
 
-                if ($relation['type'] === Doctrine_Relation::ONE ||
-                    $relation['type'] === Doctrine_Relation::ONE_COMPOSITE) {
+                if ($relation['type'] === Doctrine_Relation::ONE) {
                     $ret[$i] = "    ".'$this->hasOne(\'' . $class . $alias . 
'\'';
                 } else {
                     $ret[$i] = "    ".'$this->hasMany(\'' . $class . $alias . 
'\'';

Modified: branches/1.0/lib/Doctrine/Record/Abstract.php
===================================================================
--- branches/1.0/lib/Doctrine/Record/Abstract.php       2008-08-27 02:30:02 UTC 
(rev 4829)
+++ branches/1.0/lib/Doctrine/Record/Abstract.php       2008-08-27 02:45:11 UTC 
(rev 4830)
@@ -193,7 +193,7 @@
      */
     public function hasOne()
     {
-        $this->_table->bind(func_get_args(), Doctrine_Relation::ONE_AGGREGATE);
+        $this->_table->bind(func_get_args(), Doctrine_Relation::ONE);
 
         return $this;
     }
@@ -209,7 +209,7 @@
      */
     public function hasMany()
     {
-        $this->_table->bind(func_get_args(), 
Doctrine_Relation::MANY_AGGREGATE);
+        $this->_table->bind(func_get_args(), Doctrine_Relation::MANY);
 
         return $this;
     }

Modified: branches/1.0/lib/Doctrine/Relation.php
===================================================================
--- branches/1.0/lib/Doctrine/Relation.php      2008-08-27 02:30:02 UTC (rev 
4829)
+++ branches/1.0/lib/Doctrine/Relation.php      2008-08-27 02:45:11 UTC (rev 
4830)
@@ -38,27 +38,14 @@
      */
 
     /**
-     * constant for ONE_TO_ONE and MANY_TO_ONE aggregate relationships
+     * constant for ONE_TO_ONE and MANY_TO_ONE relationships
      */
-    const ONE_AGGREGATE         = 0;
-
+    const ONE   = 0;
+    
     /**
-     * constant for ONE_TO_ONE and MANY_TO_ONE composite relationships
+     * constant for MANY_TO_MANY and ONE_TO_MANY relationships
      */
-    const ONE_COMPOSITE         = 1;
-
-    /**
-     * constant for MANY_TO_MANY and ONE_TO_MANY aggregate relationships
-     */
-    const MANY_AGGREGATE        = 2;
-
-    /**
-     * constant for MANY_TO_MANY and ONE_TO_MANY composite relationships
-     */
-    const MANY_COMPOSITE        = 3;
-
-    const ONE   = 0;
-    const MANY  = 2;
+    const MANY  = 1;
     
     // TRUE => mandatory, everything else is just a default value. this should 
be refactored
     // since TRUE can bot be used as a default value this way. All values 
should be default values.
@@ -306,18 +293,6 @@
     }
 
     /**
-     * isComposite
-     * returns whether or not this relation is a composite relation
-     *
-     * @return boolean
-     */
-    final public function isComposite()
-    {
-        return ($this->definition['type'] == Doctrine_Relation::ONE_COMPOSITE 
||
-                $this->definition['type'] == 
Doctrine_Relation::MANY_COMPOSITE);
-    }
-
-    /**
      * isOneToOne
      * returns whether or not this relation is a one-to-one relation
      *
@@ -325,8 +300,7 @@
      */
     final public function isOneToOne()
     {
-        return ($this->definition['type'] == Doctrine_Relation::ONE_AGGREGATE 
||
-                $this->definition['type'] == Doctrine_Relation::ONE_COMPOSITE);
+        return ($this->definition['type'] == Doctrine_Relation::ONE);
     }
 
     /**

Modified: branches/1.0/tests/RecordTestCase.php
===================================================================
--- branches/1.0/tests/RecordTestCase.php       2008-08-27 02:30:02 UTC (rev 
4829)
+++ branches/1.0/tests/RecordTestCase.php       2008-08-27 02:45:11 UTC (rev 
4830)
@@ -441,7 +441,7 @@
 
         $fk = $e->getTable()->getRelation("Child");
         $this->assertTrue($fk instanceof Doctrine_Relation_ForeignKey);
-        $this->assertEqual($fk->getType(), Doctrine_Relation::MANY_AGGREGATE);
+        $this->assertEqual($fk->getType(), Doctrine_Relation::MANY);
         $this->assertEqual($fk->getForeign(), "parent_id");
         $this->assertEqual($fk->getLocal(), "id");
 

Modified: branches/1.0/tests/TableTestCase.php
===================================================================
--- branches/1.0/tests/TableTestCase.php        2008-08-27 02:30:02 UTC (rev 
4829)
+++ branches/1.0/tests/TableTestCase.php        2008-08-27 02:45:11 UTC (rev 
4830)
@@ -99,14 +99,14 @@
         $fk = $this->objTable->getRelation("Group");
         $this->assertTrue($fk instanceof Doctrine_Relation_Association);
         $this->assertTrue($fk->getTable() instanceof Doctrine_Table);
-        $this->assertTrue($fk->getType() == Doctrine_Relation::MANY_AGGREGATE);
+        $this->assertTrue($fk->getType() == Doctrine_Relation::MANY);
         $this->assertTrue($fk->getLocal() == "user_id");
         $this->assertTrue($fk->getForeign() == "group_id");
 
         $fk = $this->objTable->getRelation("Email");
         $this->assertTrue($fk instanceof Doctrine_Relation_LocalKey);
         $this->assertTrue($fk->getTable() instanceof Doctrine_Table);
-        $this->assertTrue($fk->getType() == Doctrine_Relation::ONE_AGGREGATE);
+        $this->assertTrue($fk->getType() == Doctrine_Relation::ONE);
         $this->assertTrue($fk->getLocal() == "email_id");
         $this->assertTrue($fk->getForeign() == 
$fk->getTable()->getIdentifier());
 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"doctrine-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.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---

Reply via email to