M
M
m1zysh0w2017-07-14 09:58:16
1C-Bitrix
m1zysh0w, 2017-07-14 09:58:16

How to access created database via ORM?

Good day. Faced one question: How to access the created database through ORM?
Help me please!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sidorov, 2017-07-14
@serjazz

Documentation on D7 (if the question is about it) is located here The
request is executed using standard getList (), for example:

$filterVal = array(
        'select' => array(
            'ID',
        ),
        'filter' => array(
            '=GROUP_ID' => $_REQUEST['REMOVE_GROUP']
        )
    );
$propID = RE\TemplatePropertyTable::getList($filterVal)->fetchAll(); //получаем массив всех данных

where RE\TemplatePropertyTable is a description of the base table extending the DataManager class - TemplatePropertyTable extends Entity\DataManager (more on that here)
<?php require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php"); ?>
<?php
CModule::IncludeModule("iblock"); //подключаем модуль инфоблоков

$arSelect = Array("ID", "IBLOCK_ID", "NAME", "DATE_ACTIVE_FROM","PROPERTY_*");
$arFilter = Array("IBLOCK_ID"=>IntVal($yvalue), "ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y");
$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>50), $arSelect); //делаем выборку
while($ob = $res->GetNextElement()){ 
 $arFields = $ob->GetFields();  
print_r($arFields);
 $arProps = $ob->GetProperties();
print_r($arProps);
}
?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question