public static function count ($request, $match)
    {
        $userId = $request->user ? $request->user->id : 0;
        $sql = new Pluf_SQL('account_id=%s', array($userId));
        
        $message = new User_Message();
        $res = $message->getList(
                array(
                        'count' => true,
                        'filter' => $sql->gen()
                ));
        // Check permission
        return $res[0]['nb_items'];
    }
public static function count ($request, $match)
    {
        $userId = $request->user ? $request->user->id : 0;
        $sql = new Pluf_SQL('account_id=%s', array($userId));
        
        $message = new User_Message();
        $res = $message->getList(
                array(
                        'count' => true,
                        'filter' => $sql->gen()
                ));
        // Check permission
        return $res[0]['nb_items'];
    }
public static function count ( $ request , $ match ) { $ userId = $ request -> user ? $ request -> user -> id : 0 ; $ sql = new Pluf_SQL ( 'account_id=%s' , array ( $ userId ) ) ; $ message = new User_Message ( ) ; $ res = $ message -> getList ( array ( 'count' => true , 'filter' => $ sql -> gen ( ) ) ) ; // Check permission return $ res [ 0 ] [ 'nb_items' ] ; }
Retruns messages count

@param Pluf_HTTP_Request $request
@param array $match
Retruns messages count