Author: rande
Date: 2010-01-18 12:54:29 +0100 (Mon, 18 Jan 2010)
New Revision: 26807
Modified:
plugins/sfSolrPlugin/branches/sf1.2/lib/indexer/sfLuceneDoctrineIndexer.class.php
plugins/sfSolrPlugin/branches/sf1.2/lib/indexer/sfLuceneDoctrineIndexerHandler.class.php
plugins/sfSolrPlugin/branches/sf1.2/lib/indexer/sfLuceneModelIndexer.class.php
Log:
[sfSolrPlugin] fix doctrine collection and object management
Modified:
plugins/sfSolrPlugin/branches/sf1.2/lib/indexer/sfLuceneDoctrineIndexer.class.php
===================================================================
---
plugins/sfSolrPlugin/branches/sf1.2/lib/indexer/sfLuceneDoctrineIndexer.class.php
2010-01-18 11:28:31 UTC (rev 26806)
+++
plugins/sfSolrPlugin/branches/sf1.2/lib/indexer/sfLuceneDoctrineIndexer.class.php
2010-01-18 11:54:29 UTC (rev 26807)
@@ -216,9 +216,14 @@
{
$values[] = $object->__toString();
}
-
+
return $values;
}
+ else if($value instanceof Doctrine_Record)
+ {
+
+ $value = $value->__toString();
+ }
return $value;
}
Modified:
plugins/sfSolrPlugin/branches/sf1.2/lib/indexer/sfLuceneDoctrineIndexerHandler.class.php
===================================================================
---
plugins/sfSolrPlugin/branches/sf1.2/lib/indexer/sfLuceneDoctrineIndexerHandler.class.php
2010-01-18 11:28:31 UTC (rev 26806)
+++
plugins/sfSolrPlugin/branches/sf1.2/lib/indexer/sfLuceneDoctrineIndexerHandler.class.php
2010-01-18 11:54:29 UTC (rev 26807)
@@ -99,7 +99,7 @@
$field = $doc->getField('id');
- $pks[] = $field['value'];
+ $pks[] = $field['value']['0'];
unset($record);
}
Modified:
plugins/sfSolrPlugin/branches/sf1.2/lib/indexer/sfLuceneModelIndexer.class.php
===================================================================
---
plugins/sfSolrPlugin/branches/sf1.2/lib/indexer/sfLuceneModelIndexer.class.php
2010-01-18 11:28:31 UTC (rev 26806)
+++
plugins/sfSolrPlugin/branches/sf1.2/lib/indexer/sfLuceneModelIndexer.class.php
2010-01-18 11:54:29 UTC (rev 26807)
@@ -235,15 +235,15 @@
$value = array($value);
}
- foreach($value as $v)
+ foreach($value as $pos => $v)
{
if($transform)
{
- $v = call_user_func($transform, $v);
+ $value[$pos] = call_user_func($transform, $v);
}
-
- $doc->setField($field, $v, $boost);
}
+
+ $doc->setField($field, $value, $boost);
}
return $doc;
--
You received this message because you are subscribed to the Google Groups
"symfony 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.com/group/symfony-svn?hl=en.