CLQuestion::GetList
CDBResult CLQuestion::GetList( array arOrder = Array("TIMESTAMP_X"=>"DESC"), array arFilter = Array() );
The GetList method returns the list of questions filtered by arFilter and sorted in the arOrder order.
Parameters
Parameter | Description |
---|---|
arOrder |
An array in the format array("filter field"=>"sort
order" [, ...]). The sorting field can have the following values:
|
arFilter |
An array in the format array("filtered
field"=>"filter value" [, ...]). The following
values are possible:
Optional. By default, records are not filtered. |
Return Values
The method returns an instance of the CDBResult object.
See Also
Example
<? if (CModule::IncludeModule("learning")) { $LESSON_ID = 426; $res = CLQuestion::GetList( Array("TIMESTAMP_X" => "ASC", "SORT"=>"ASC"), Array("LESSON_ID" => $LESSON_ID) ); while ($arQuestion = $res->GetNext()) { echo "Question name: ".$arQuestion["NAME"]."<br>"; } } ?>
<? if (CModule::IncludeModule("learning")) { $COURSE_ID = 97; $res = CLQuestion::GetList( Array("SORT"=>"ASC"), Array("ACTIVE" => "Y", "COURSE_ID" => $COURSE_ID) ); while ($arQuestion = $res->GetNext()) { echo "Question name: ".$arQuestion["NAME"]."<br>"; } } ?>
<? if (CModule::IncludeModule("learning")) { $res = CLQuestion::GetList( Array("SORT"=>"ASC"), Array("?NAME" => "Site") ); while ($arQuestion = $res->GetNext()) { echo "Question name: ".$arQuestion["NAME"]."<br>"; } } ?>
<? if (CModule::IncludeModule("learning")) { $COURSE_ID = 97; $res = CLQuestion::GetList( Array("NAME" => "ASC", "SORT"=>"ASC"), Array("COURSE_ID" => $COURSE_ID, "!SELF" => "Y") ); while ($arQuestion = $res->GetNext()) { echo "Question name: ".$arQuestion["NAME"]."<br>"; } } ?>
© «Bitrix24», 2001-2024