F
F
Fisher212017-04-19 11:03:31
ORM
Fisher21, 2017-04-19 11:03:31

ORM Bitrix, how to correctly make a request to get the values ​​of a multiple property of the "Binding to highloadblock elements" type?

Question for Bitrix ORM connoisseurs, there are two highload infoblocks, Commission and Worker, the Commission entity has a UF_MEMBERS field - which is a binding to the elements of the Worker entity and it is multiple, how to correctly compose an ORM request for GetList to get all values ​​of the multiple UF_MEMBERS field, the code below works when this field is not multiple, in the case of a multiple field, the fields created at runtime come up empty.
ORM query printout:

Array
(
    [select] => Array
        (
            [0] => *
            [REF_UF_MEMBERS] => Worker_UF_FULL_NAME.UF_FULL_NAME
        )

    [filter] => Array
        (
        )

    [group] => Array
        (
        )

    [order] => Array
        (
            [UF_NAME] => desc
        )

    [limit] => 20
    [offset] => 0
    [runtime] => Array
        (
            [Worker_UF_FULL_NAME] => Array
                (
                    [data_type] => \Worker
                    [reference] => Array
                        (
                            [=this.UF_MEMBERS] => ref.ID
                        )

                    [join_type] => left
                )

        )

)

Printout of the result, field REF_UF_MEMBERS is empty, although UF_MEMBERS contains 3 values:
Array
(
    [ID] => 1
    [UF_NAME] => Тест
    [UF_DATE] => Bitrix\Main\Type\Date Object
        (
            [value:protected] => DateTime Object
                (
                    [date] => 2017-04-12 00:00:00
                    [timezone_type] => 3
                    [timezone] => Europe/Moscow
                )

        )

    [UF_MEMBERS] => Array
        (
            [0] => 45
            [1] => 46
            [2] => 47
        )

    [UF_COMPANY_ID] => 
    [REF_UF_MEMBERS] => 
)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Maksimenko, 2017-04-20
@olegprof

It's easier to build this thing in php. Collect UF_MEMBERS into a common array, extract information about them from the Worker, substitute the received data into the resulting selection.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question