/**
  * {@inheritDoc}
  */
 public function getShortDesc()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getShortDesc', array());
     return parent::getShortDesc();
 }
コード例 #2
0
 public function addAetCommunicationToSearchIndex($index, Communication $aetCommunication)
 {
     // Create a new document
     $document = new Document();
     $document->addField(Field::keyword('dbId', $aetCommunication->getId(), 'utf-8'));
     $document->addField(Field::unStored('title', $aetCommunication->getTitle(), 'utf-8'));
     $document->addField(Field::unStored('shortdesc', $aetCommunication->getShortDesc(), 'utf-8'));
     $document->addField(Field::unStored('body', html_entity_decode(strip_tags($aetCommunication->getBody()), ENT_SUBSTITUTE, 'UTF-8'), 'utf-8'));
     $document->addField(Field::unStored('author', $aetCommunication->getUser()->getFirstname() . " " . $aetCommunication->getUser()->getLastname(), 'utf-8'));
     // Add your document to the index
     $index->addDocument($document);
     // Commit your change
     $index->commit();
     $index->optimize();
 }