Beispiel #1
0
 /**
  * Returns list of properties IDs linked to the section according their "TYPE".
  * Property has to be not only linked to the section, but has to be marked as smart filter one.
  * - N - maps to Indexer::NUMERIC
  * - S - to Indexer::STRING
  * - F, E, G, L - to Indexer::DICTIONARY
  *
  * @param integer $sectionId Section for with properties will be returned.
  *
  * @return integer[]
  */
 protected function getSectionFilterProperty($sectionId)
 {
     if (!isset($this->sectionFilter[$sectionId])) {
         $properties = array();
         foreach (\CIBlockSectionPropertyLink::getArray($this->iblockId, $sectionId) as $PID => $link) {
             if ($link["SMART_FILTER"] === "Y") {
                 if ($link["PROPERTY_TYPE"] === "N") {
                     $properties[$link["PROPERTY_ID"]] = Storage::NUMERIC;
                 } elseif ($link["USER_TYPE"] === "DateTime") {
                     $properties[$link["PROPERTY_ID"]] = Storage::DATETIME;
                 } elseif ($link["PROPERTY_TYPE"] === "S") {
                     $properties[$link["PROPERTY_ID"]] = Storage::STRING;
                 } else {
                     $properties[$link["PROPERTY_ID"]] = Storage::DICTIONARY;
                 }
             }
         }
         if ($this->skuIblockId) {
             foreach (\CIBlockSectionPropertyLink::getArray($this->skuIblockId, $sectionId) as $PID => $link) {
                 if ($link["SMART_FILTER"] === "Y") {
                     if ($link["PROPERTY_TYPE"] === "N") {
                         $properties[$link["PROPERTY_ID"]] = Storage::NUMERIC;
                     } elseif ($link["USER_TYPE"] === "DateTime") {
                         $properties[$link["PROPERTY_ID"]] = Storage::DATETIME;
                     } elseif ($link["PROPERTY_TYPE"] === "S") {
                         $properties[$link["PROPERTY_ID"]] = Storage::STRING;
                     } else {
                         $properties[$link["PROPERTY_ID"]] = Storage::DICTIONARY;
                     }
                 }
             }
         }
         $this->sectionFilter[$sectionId] = $properties;
     }
     return $this->sectionFilter[$sectionId];
 }