A
A
Askfortrue2021-12-17 08:15:30
1C-Bitrix
Askfortrue, 2021-12-17 08:15:30

How does sampling work in Bitrix?

Good afternoon comrades!
I could not figure out the sampling documentation in Bitrix. Give an example.
They write about the BookTable entity and provide the following code

BookTable::getList(array(
    'select'  => ... // имена полей, которые необходимо получить в результате
    'filter'  => ... // описание фильтра для WHERE и HAVING
    'group'   => ... // явное указание полей, по которым нужно группировать результат
    'order'   => ... // параметры сортировки
    'limit'   => ... // количество записей
    'offset'  => ... // смещение для limit
    'runtime' => ... // динамически определенные поля
));

What exactly I didn’t understand, why it didn’t work out - I’m interested in the BLOG_POST entity, I’m going to display certain posts in a certain field, that is, if the field is filled, then display it, if not, then not, and count the number of elements (or rows) in the selection.
How to apply this function to the BLOG_POST entity? how could it look like?
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Morozov, 2021-12-19
@Q_BASIC

You are looking at the new D7 API, not all entities support it.
How to get blog posts, see the code of the components that are responsible for this. For example bitrix:blog.post

A
Askfortrue, 2021-12-20
@Askfortrue

I returned to this question, answered you and, as usual, you start to think quickly because a long-term problem is annoying and that's it.
I found such a code, in the examples for the documentation, I cut it to the desired one,

<?
$SORT = Array("ID" => "DESC");
$arFilter = Array(
    "NUM_COMMENTS" => '1',
    );	
?>

he remarkably filters and makes a selection!
Thank you for your attention.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question