示例#1
0
 /**
  * {@inheritdoc}
  */
 public function getMatchingIds()
 {
     if ($this->objAttribute instanceof ITranslated) {
         return $this->objAttribute->searchForInLanguages($this->strValue, $this->arrValidLanguages);
     }
     return $this->objAttribute->searchFor($this->strValue);
 }
示例#2
0
文件: MetaModel.php 项目: zonky2/core
 /**
  * This method is called to retrieve the data for certain items from the database.
  *
  * @param ITranslated $attribute The attribute to fetch the values for.
  *
  * @param string[]    $ids       The ids of the items to retrieve the order of ids is used for sorting of the return
  *                               values.
  *
  * @return array an array of all matched items, sorted by the id list.
  */
 protected function fetchTranslatedAttributeValues(ITranslated $attribute, $ids)
 {
     $attributeData = $attribute->getTranslatedDataFor($ids, $this->getActiveLanguage());
     $missing = array_diff($ids, array_keys($attributeData));
     if ($missing) {
         $attributeData += $attribute->getTranslatedDataFor($missing, $this->getFallbackLanguage());
     }
     return $attributeData;
 }