~fabiocbalbuquerque/sahana-agasti/web-services

« back to all changes in this revision

Viewing changes to apps/frontend/lib/model/doctrine/agFacility.class.php

  • Committer: Chad Heuschober
  • Date: 2011-06-06 13:37:45 UTC
  • mfrom: (1.1.1244 trunk)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: chad.heuschober@mail.cuny.edu-20110606133745-850mdvnjtv392zta
Pulled in most recent batch of changes from the cuny sps trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    $this->isAutoIndexed = $isAutoIndexed;
27
27
  }
28
28
 
29
 
  public function postSave($event)
30
 
  {
31
 
    if ($this->isAutoIndexed) {
32
 
      parent::postSave($event);
33
 
    }
34
 
  }
35
 
 
36
 
  public function postDelete($event)
37
 
  {
38
 
    if ($this->isAutoIndexed) {
39
 
      parent::postDelete($event);
40
 
    }
41
 
  }
42
 
 
43
29
  /**
44
30
   * Builds an index for facility.
45
31
   *
52
38
   */
53
39
  public function updateLucene()
54
40
  {
 
41
    if (!$this->isAutoIndexed) {
 
42
      return null;
 
43
    }
 
44
    Zend_Search_Lucene_Analysis_Analyzer::setDefault(
 
45
        new Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum_CaseInsensitive());
55
46
    $doc = new Zend_Search_Lucene_Document();
56
47
    $doc->addField(Zend_Search_Lucene_Field::Keyword('Id', $this->id, 'utf-8'));
57
48
    $doc->addField(Zend_Search_Lucene_Field::unStored('facility', $this->facility_name, 'utf-8'));
58
 
    //$doc->addField(Zend_Search_Lucene_Field::unStored('facility_code', $this->facility_code, 'utf-8'));
 
49
    $doc->addField(Zend_Search_Lucene_Field::unStored('facility_code', $this->facility_code, 'utf-8'));
59
50
 
60
51
    $facilityInfo = agDoctrineQuery::create()
61
52
            ->select('f.id, fr.id, frt.id, frt.facility_resource_type, frt.facility_resource_type_abbr')