- Модуль: iblock
- Путь к файлу: ~/bitrix/modules/iblock/lib/propertyindex/facet.php
- Класс: BitrixIblockPropertyIndexFacet
- Вызов: Facet::addDatetimePropertyFilter
public function addDatetimePropertyFilter($propertyId, $operator, $value)
{
$facetId = $this->storage->propertyIdToFacetId($propertyId);
if ($operator == "<=" || $operator == ">=")
{
$this->where[$operator.$facetId] = array(
"TYPE" => Storage::DATETIME,
"OP" => $operator,
"FACET_ID" => $facetId,
"VALUES" => array(intval($value)),
);
if (isset($this->where[">=".$facetId]) && isset($this->where["<=".$facetId]))
{
$this->where["><".$facetId] = array(
"TYPE" => Storage::DATETIME,
"OP" => "><",
"FACET_ID" => $facetId,
"VALUES" => array(
$this->where[">=".$facetId]["VALUES"][0],
$this->where["<=".$facetId]["VALUES"][0]
),
);
unset($this->where[">=".$facetId]);
unset($this->where["<=".$facetId]);
}
}
elseif ($operator == "=")
{
if (isset($this->where[$operator.$facetId]))
{
$this->where[$operator.$facetId]["VALUES"][] = intval($value);
}
else
{
$this->where[$operator.$facetId] = array(
"TYPE" => Storage::DATETIME,
"OP" => $operator,
"FACET_ID" => $facetId,
"VALUES" => array(intval($value)),
);
}
}
}