Example #1
0
 public function __construct(EntityMeta $entityMeta, $maxResults = 15)
 {
     $acRequest = $entityMeta->getAutoCompleteRequestMeta(array('term' => NULL));
     $item = new stdClass();
     $item->genitiv = $entityMeta->getGenitiv();
     $item->fields = \Psc\FE\Helper::listStrings($entityMeta->getAutoCompleteFields(), ', ', ' oder ');
     $item->type = $entityMeta->getEntityName();
     $item->url = $acRequest->getUrl();
     $item->label = $entityMeta->getLabel(EntityMeta::CONTEXT_AUTOCOMPLETE);
     $item->data = array();
     parent::__construct($item);
     $this->maxResults = $maxResults;
     // copy from meta
     // (hier die setter nehmen falls wir mal den search panel schön bauen sollten ;))
     $this->setLabel($entityMeta->getAutoCompleteHeadline());
     $this->setAutoCompleteDelay($entityMeta->getAutoCompleteDelay());
     $this->setAutoCompleteBody($acRequest->getBody());
     $this->setAutoCompleteMinLength($entityMeta->getAutoCompleteMinLength());
 }
Example #2
0
 /**
  * @dataProvider listStringsParams
  */
 public function testListStrings(array $array, $expectedString, $andsep, $sep, $print)
 {
     $this->assertEquals($expectedString, \Psc\FE\Helper::listStrings($array, $sep, $andsep, $print));
 }