Answer the question
In order to leave comments, you need to log in
How to filter by the value of the infoblock property in Bitrix D7?
Hello! I decided to transfer to a new core, but everywhere I plugged it. The next question is how to filter elements by property?
As it was before: $arFilter = array('PROPERTY_XXX'=>'YYY');
Well, then we pass it to CIBlock::GetList.
Now I try like this:
\Bitrix\Main\Loader::includeModule('iblock');
$queryPost = new \Bitrix\Main\Entity\Query(\Bitrix\Iblock\ElementTable::getEntity());
$queryPost
->setSelect(array(
'ID','IBLOCK_ID'
))
->setFilter(array(
'IBLOCK_ID' => 4,
'PROPERTY_SHOW_ON_MAIN' => 'Y'
))
->setLimit(1);
$arRes = $queryPost->exec()->fetchAll();
Unknown field definition `UF_SHOW_ON_MAIN` (UF_SHOW_ON_MAIN) for Element Entity. (100)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question