bubasuma\simplechat\db\Message::get PHP Method

get() public static method

Since: 2.0
public static get ( integer $userId, integer $contactId, integer $limit, boolean $history = true, integer $key = null ) : DataProvider
$userId integer
$contactId integer
$limit integer
$history boolean
$key integer
return bubasuma\simplechat\DataProvider
    public static function get($userId, $contactId, $limit, $history = true, $key = null)
    {
        $query = static::baseQuery($userId, $contactId);
        if (null !== $key) {
            $query->andWhere([$history ? '<' : '>', 'id', $key]);
        }
        return new DataProvider(['query' => $query, 'pagination' => ['pageSize' => $limit]]);
    }