Author: sevein
Date: Fri Feb 10 10:28:19 2012
New Revision: 10844

Log:
Avoid to call getCollectionRoot() many times

Modified:
   trunk/lib/QubitSearch.class.php

Modified: trunk/lib/QubitSearch.class.php
==============================================================================
--- trunk/lib/QubitSearch.class.php     Fri Feb 10 08:09:31 2012        (r10843)
+++ trunk/lib/QubitSearch.class.php     Fri Feb 10 10:28:19 2012        (r10844)
@@ -483,9 +483,10 @@
     $doc->addField(Zend_Search_Lucene_Field::UnIndexed('parentId', 
$informationObject->parentId));
     $doc->addField(Zend_Search_Lucene_Field::Keyword('parent', 
$informationObject->parent->slug));
 
-    $doc->addField(Zend_Search_Lucene_Field::UnIndexed('collectionRootId', 
$informationObject->getCollectionRoot()->id));
-    $doc->addField(Zend_Search_Lucene_Field::Keyword('collectionRootSlug', 
$informationObject->getCollectionRoot()->slug));
-    $doc->addField(Zend_Search_Lucene_Field::UnIndexed('collectionRootTitle', 
$informationObject->getCollectionRoot()->getTitle()));
+    $collectionRoot = $informationObject->getCollectionRoot();
+    $doc->addField(Zend_Search_Lucene_Field::UnIndexed('collectionRootId', 
$collectionRoot->id));
+    $doc->addField(Zend_Search_Lucene_Field::Keyword('collectionRootSlug', 
$collectionRoot->slug));
+    $doc->addField(Zend_Search_Lucene_Field::UnIndexed('collectionRootTitle', 
$collectionRoot->getTitle()));
 
     // Digital object information
     if ($digitalObject = $informationObject->getDigitalObject())

-- 
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