*/
protected $title = '';
+ /**
+ * @var string
+ */
+ protected $displayedTitle='';
+
/**
* @var string
*/
$this->keywords = $keywords;
}
+
+ /**
+ * @return string
+ */
+ public function getDisplayedTitle(): string
+ {
+ return $this->displayedTitle?:$this->getTitle();
+ }
+
+ /**
+ * @param string $displayedTitle
+ */
+ public function setDisplayedTitle(string $displayedTitle): void
+ {
+ $this->displayedTitle = $displayedTitle;
+ }
+
/**
* @return array[]
*/
*/
public function getIndividualDocData()
{
- return ['id' => $this->getId(), 'type' => $this->getType(), 'thumb' => $this->getThumb(), 'title' => $this->getTitle(), 'url' => $this->getUrl(), 'text' => $this->getText(), 'keywords' => $this->getKeywords()];
+ return ['id' => $this->getId(), 'type' => $this->getType(), 'thumb' => $this->getThumb(), 'title' => $this->getTitle(), 'url' => $this->getUrl(), 'text' => $this->getText(), 'keywords' => $this->getKeywords(),'displayedTitle'=>$this->getDisplayedTitle()];
}
}
\ No newline at end of file
file_put_contents($this->getOutput(), $this->generateCode());
}
- public function generateCode($fields = 'title,text,keywords', $storeFields = 'id,title,text,type,url,thumb',$prefix=true,$fuzzy=0.2)
+ public function generateCode($fields = 'title,text,keywords', $storeFields = 'id,displayedTitle,text,type,url,thumb',$prefix=true,$fuzzy=0.2)
{
$res = [];
foreach ($this->documents as $document) {