/
3vweb
/
testTask
Обзор
Документация
Войти
/
3vweb
/
testTask
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
local/classes/Entity/Hl/CarsTable.php
49 строк
1 KB
ubuntu
Решение к задаче
15 янв 2026, 12:28
15 янв 2026, 12:28
30b8481
Код
Авторство
О чём код?
<?php namespace Local\Classes\Entity\Hl; use Bitrix\Main\ORM\Data\DataManager; use Bitrix\Main\ORM\Fields\IntegerField; use Bitrix\Main\ORM\Fields\TextField; use Bitrix\Main\ORM\Fields\Relations\Reference; use Bitrix\Main\ORM\Query\Join; /** * Список машин (UF_CAR_CLASS_ID можно добавить в индекс) */ class CarsTable extends DataManager { /** * Returns DB table name for entity. * * @return string */ public static function getTableName() { return 'hl_car_list'; } /** * Returns entity map definition. * * @return array */ public static function getMap() { return [ (new IntegerField('ID'))->configurePrimary(), new TextField('UF_NAME'), new TextField('UF_DRIVER_NAME'), new IntegerField('UF_CAR_CLASS_ID'), new Reference( 'CAR_CLASS', CarClassTable::class, Join::on('this.UF_CAR_CLASS_ID', 'ref.ID') ), new Reference( 'CAR_HISTORY', CarHistoryTable::class, Join::on('this.ID', 'ref.UF_CARS_ID') ), ]; } }