/**
  * {@inheritdoc}
  */
 public function getMatchingIds()
 {
     if (in_array('IMetaModelAttributeTranslated', class_implements($this->objAttribute))) {
         return $this->objAttribute->searchForInLanguages($this->strValue, $this->arrValidLanguages);
     } else {
         return $this->objAttribute->searchFor($this->strValue);
     }
 }
Ejemplo n.º 2
0
 /**
  * Helper function for {@see MetaModelItem::parseValue()} and {@see MetaModelItem::parseAttribute()}.
  *
  * @param IMetaModelAttribute      $objAttribute    The attribute to parse.
  *
  * @param string                   $strOutputFormat The desired output format.
  *
  * @param IMetaModelRenderSettings $objSettings     The settings object to be applied.
  *
  * @return array The parsed information for the given attribute.
  */
 public function internalParseAttribute($objAttribute, $strOutputFormat, $objSettings)
 {
     $arrResult = array();
     if ($objAttribute) {
         // Extract view settings for this attribute.
         if ($objSettings) {
             $objAttributeSettings = $objSettings->getSetting($objAttribute->getColName());
         } else {
             $objAttributeSettings = null;
         }
         foreach ($objAttribute->parseValue($this->arrData, $strOutputFormat, $objAttributeSettings) as $strKey => $varValue) {
             $arrResult[$strKey] = $varValue;
         }
         // TODO: Add parseValue HOOK?
     }
     // If "hideEmptyValues" is true and the raw is empty remove text and output format.
     if (!is_null($objSettings) && $objSettings->get('hideEmptyValues') == true && $this->isEmptyValue($arrResult['raw']) == true) {
         unset($arrResult[$strOutputFormat]);
         unset($arrResult['text']);
     }
     return $arrResult;
 }
 /**
  * Fetch the ids for all items that hold a value that is less than the passed value.
  *
  * If no entries have been found, the result is an empty array.
  *
  * @return int[]|null
  */
 public function getMatchingIds()
 {
     return $this->objAttribute->filterLessThan($this->varValue, $this->blnInclusive);
 }
Ejemplo n.º 4
0
 /**
  * Adds an attribute to the internal list of attributes.
  *
  * @param IMetaModelAttribute $objAttribute The attribute instance to add.
  *
  * @return IMetaModel self for chaining
  */
 protected function addAttribute(IMetaModelAttribute $objAttribute)
 {
     $this->arrAttributes[$objAttribute->getColName()] = $objAttribute;
 }
 /**
  * Fetch the ids for all items that hold a value that is not equal to the passed value.
  *
  * If no entries have been found, the result is an empty array.
  *
  * @return int[]|null
  */
 public function getMatchingIds()
 {
     return $this->objAttribute->filterNotEqual($this->varValue);
 }