31 public static function find(
33 array $order = [
'ID' =>
'DESC'],
38 $context = $context ?? Locator::getContext();
40 $messageOrder = [
'ID' =>
'DESC'];
42 if (isset($order[
'ID']))
44 $messageOrder[
'ID'] = $order[
'ID'];
47 $query = LinkFavoriteTable::query()
48 ->setSelect([
'MESSAGE',
'ID',
'CHAT_ID',
'AUTHOR_ID',
'DATE_CREATE',
'MESSAGE_ID'])
49 ->where(
'AUTHOR_ID', $context->getUserId())
50 ->setOrder($messageOrder)
54 $query->setLimit($limit);
56 static::processFilters($query, $filter, $messageOrder);
58 return static::initByEntityCollection($query->fetchCollection());