Author: jablko
Date: Wed Oct 27 23:40:50 2010
New Revision: 8602

Log:
Actor relation type is required, or the relation won't be returned by 
->getActorRelations(), and won't be displayed on edit or show pages

Modified:
   trunk/lib/model/QubitActor.php

Modified: trunk/lib/model/QubitActor.php
==============================================================================
--- trunk/lib/model/QubitActor.php      Wed Oct 27 22:51:08 2010        (r8601)
+++ trunk/lib/model/QubitActor.php      Wed Oct 27 23:40:50 2010        (r8602)
@@ -446,15 +446,11 @@
   public function getActorRelations()
   {
     $criteria = new Criteria;
-
     $criteria->addJoin(QubitRelation::TYPE_ID, QubitTerm::ID);
+    $criteria->add($criteria->getNewCriterion(QubitRelation::OBJECT_ID, 
$this->id)
+      ->addOr($criteria->getNewCriterion(QubitRelation::SUBJECT_ID, $this->id)
+        ->addAnd($criteria->getNewCriterion(QubitTerm::TAXONOMY_ID, 
QubitTaxonomy::ACTOR_RELATION_TYPE_ID))));
 
-    $criterion1 = $criteria->getNewCriterion(QubitRelation::OBJECT_ID, 
$this->id);
-    $criterion2 = $criteria->getNewCriterion(QubitRelation::SUBJECT_ID, 
$this->id);
-    $criterion3 = $criteria->getNewCriterion(QubitTerm::TAXONOMY_ID, 
QubitTaxonomy::ACTOR_RELATION_TYPE_ID);
-    $criterion1->addOr($criterion2);
-    $criterion1->addAnd($criterion3);
-    $criteria->add($criterion1);
     $criteria->addAscendingOrderByColumn(QubitRelation::TYPE_ID);
     $criteria->addDescendingOrderByColumn(QubitRelation::START_DATE);
 

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" 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/qubit-commits?hl=en.

Reply via email to