V
V
vladimirship2017-09-12 15:08:49
PHP
vladimirship, 2017-09-12 15:08:49

Bitrix: Is there an analogue of ACTIVE_DATE for infoblock elements in d7?

Hello. In the old kernel, active by date items could be retrieved using ACTIVE_DATE in the filter:

$elements = CIBlockElement::GetList(
      array(),
      array("ACTIVE_DATE" => "Y")
)->fetch();

How to do it in a new kernel?
Tried like this:
$elements = \Bitrix\Iblock\ElementTable::getList(array(
    "filter" => array("ACTIVE_DATE" => "Y")
))->fetch();

But it returns an error because the ACTIVE_DATE field does not exist in the ElementTable entity. What to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Emelyanov, 2017-09-12
@vladimirship

How to filter by the date property on the new D7 1C-Bitrix core?

$elements = \Bitrix\Iblock\ElementTable::getList(array(
    "filter" => array(">=ACTIVE_FROM" => "ТЕКУЩЕЕ_ВРЕМЯ", "<=ACTIVE_TO" => "ТЕКУЩЕЕ_ВРЕМЯ")
))->fetch();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question