CLAnswer::GetList
CDBResult CLAnswer::GetList( array arOrder = Array("ID"=>"DESC"), array arFilter = Array() );
The GetList method returns a selection of answers 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:
"filter values" is a single value or an array. 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")) { $QUESTION_ID = 290; $res = CLAnswer::GetList( Array("SORT"=>"DESC"), Array("QUESTION_ID" => $QUESTION_ID) ); while ($arAnswer = $res->GetNext()) { echo "Answer name: ".$arAnswer["ANSWER"]."<br>"; } } ?>
<? if (CModule::IncludeModule("learning")) { $QUESTION_ID = 290; $res = CLAnswer::GetList( Array("SORT"=>"ASC"), Array("QUESTION_ID" => $QUESTION_ID, "?ANSWER" => "sys") ); while ($arAnswer = $res->GetNext()) { echo "Answer name: ".$arAnswer["ANSWER"]."<br>"; } } ?>
<? if (CModule::IncludeModule("learning")) { $QUESTION_ID = 290; $res = CLAnswer::GetList( Array(), Array("QUESTION_ID" => $QUESTION_ID, "CORRECT" => "Y") ); while ($arAnswer = $res->GetNext()) { echo "Answer name: ".$arAnswer["ANSWER"]."<br>"; } } ?>
<? if (CModule::IncludeModule("learning")) { $QUESTION_ID = 290; $res = CLAnswer::GetList( Array("TIMESTAMP_X" => "ASC", "SORT"=>"ASC"), Array("QUESTION_ID" => $QUESTION_ID) ); while ($arAnswer = $res->GetNext()) { echo "Answer name: ".$arAnswer["ANSWER"]."<br>"; } } ?>
<? if (CModule::IncludeModule("learning")) { $QUESTION_ID = 290; $res = CLAnswer::GetList( Array("RAND"=>""), Array("QUESTION_ID" => $QUESTION_ID) ); while ($arAnswer = $res->GetNext()) { echo "Answer name: ".$arAnswer["ANSWER"]."<br>"; } } ?>
© «Bitrix24», 2001-2024