/lib/behavior/templates/deleteLuceneIndex.php

https://github.com/matteosister/sfPropelLuceneableBehaviorPlugin · PHP · 16 lines · 9 code · 2 blank · 5 comment · 0 complexity · d68559ba8211447863905ff24808cd0f MD5 · raw file

  1. /**
  2. * delete lucene index for this class
  3. * @param zend lucene index $index
  4. * @return boolean
  5. */
  6. public function deleteLuceneIndex()
  7. {
  8. $index = sfLuceneableToolkit::getLuceneIndex(get_class($this));
  9. foreach ($index->find('pk:'.$this-><?php echo $method ?>) as $hit)
  10. {
  11. $index->delete($hit->id);
  12. }
  13. return true;
  14. }