K
K
Konstantin2021-12-07 14:44:22
1C-Bitrix
Konstantin, 2021-12-07 14:44:22

How to get data from "partition binding"?

Good afternoon,

There are 2 info blocks:
1. Tours. It has a Photo property with the "binding to sections" type
2. Photo. Accordingly, added photos by sections.

How to get an array with a photo from the section selected in the tour?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem Zhitnik, 2021-12-07
@art-zhitnik

Select photo elements from the corresponding section via CIblockElement::GetList()

M
Mikhail, 2021-12-08
@RuComMarket

as an option, you need to iterate over the linked sections and pull them out from each element of the image, BUT
this is an incorrect solution in terms of load.
why not create a Photo property with file types in the "Tours" infoblock, make it multiple and set it up for images.
in this case, you can immediately receive an array of files in several ways without unnecessary requests and without taking up a bunch of unnecessary tables.
It is not cost-effective to create infoblocks for single elements, for example, for images, for this there are additional fields or highload blocks, and sometimes it is more efficient to create your own tables, but this is when you become a middl.
each infoblock, which includes sections, elements, additional properties, occupies several database tables, the queries are huge, all processing is heavy in weight.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question