Proyectos de Subversion LeadersLinked - Services

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 192
Línea 198... Línea 198...
198
    }
198
    }
Línea 199... Línea 199...
199
 
199
 
200
    /**
200
    /**
201
     *
201
     *
-
 
202
     * @param int $feed_id
-
 
203
     * @param int[] $user_blocked_ids
202
     * @param int $feed_id
204
     * @param int[] $abuse_report_comment_ids
203
     * @return Comment[]
205
     * @return Comment[]
204
     */
206
     */
205
    public function fetchAllPublishedByFeedId($feed_id)
207
    public function fetchAllPublishedByFeedId($feed_id , $user_blocked_ids  = [], $abuse_report_comment_ids = [])
206
    {
208
    {
Línea 207... Línea 209...
207
        $prototype = new Comment();
209
        $prototype = new Comment();
208
 
210
 
209
        $select = $this->sql->select(self::_TABLE);
211
        $select = $this->sql->select(self::_TABLE);
210
        $select->where->equalTo('feed_id', $feed_id);
212
        $select->where->equalTo('feed_id', $feed_id);
211
        $select->where->equalTo('status', Feed::STATUS_PUBLISHED);
213
        $select->where->equalTo('status', Feed::STATUS_PUBLISHED);
Línea -... Línea 214...
-
 
214
        $select->where->equalTo('relational', Comment::RELATIONAL_FEED);
-
 
215
        $select->where->IsNull('parent_id');
-
 
216
        
-
 
217
        if($user_blocked_ids) {
-
 
218
            $select->where->notIn('user_id', $user_blocked_ids);
-
 
219
        }
-
 
220
        
-
 
221
        
-
 
222
        if($abuse_report_comment_ids) {
212
        $select->where->equalTo('relational', Comment::RELATIONAL_FEED);
223
            $select->where->notIn('id', $abuse_report_comment_ids);
Línea 213... Línea 224...
213
        $select->where->IsNull('parent_id');
224
        }
214
        
225
        
Línea 260... Línea 271...
260
    
271
    
261
    
272
    
262
    /**
273
    /**
-
 
274
     *
-
 
275
     * @param int $post_id
263
     *
276
     * @param int[] $user_blocked_ids
264
     * @param int $post_id
277
     * @param int[] $abuse_report_comment_ids
265
     * @return Comment[]
278
     * @return Comment[]
266
     */
279
     */
267
    public function fetchAllPublishedByPostId($post_id)
280
    public function fetchAllPublishedByPostId($post_id, $user_blocked_ids = [], $abuse_report_comment_ids = [])
Línea 268... Línea 281...
268
    {
281
    {
269
        $prototype = new Comment();
282
        $prototype = new Comment();
270
 
283
 
271
        $select = $this->sql->select(self::_TABLE);
284
        $select = $this->sql->select(self::_TABLE);
272
        $select->where->equalTo('post_id', $post_id);
285
        $select->where->equalTo('post_id', $post_id);
-
 
286
        $select->where->equalTo('status', Feed::STATUS_PUBLISHED);
-
 
287
        $select->where->equalTo('relational', Comment::RELATIONAL_POST);
-
 
288
        $select->where->IsNull('parent_id');
-
 
289
        
-
 
290
        if($user_blocked_ids) {
-
 
291
            $select->where->notIn('user_id', $user_blocked_ids);
-
 
292
        }
-
 
293
        
-
 
294
        
-
 
295
        if($abuse_report_comment_ids) {
273
        $select->where->equalTo('status', Feed::STATUS_PUBLISHED);
296
            $select->where->notIn('id', $abuse_report_comment_ids);
274
        $select->where->equalTo('relational', Comment::RELATIONAL_POST);
297
        }
Línea -... Línea 298...
-
 
298
        
-
 
299
        return $this->executeFetchAllObject($select, $prototype);
-
 
300
    }
-
 
301
 
-
 
302
    /**
-
 
303
     *
-
 
304
     * @param int $comment_id
275
        $select->where->IsNull('parent_id');
305
     * @param int[] $user_blocked_ids
276
        return $this->executeFetchAllObject($select, $prototype);
306
     * @param int[] $abuse_report_comment_ids
277
    }
307
     * @return Comment[]
Línea 278... Línea 308...
278
 
308
     */
279
    public function fetchAllPublishedByCommentId($comment_id)
309
    public function fetchAllPublishedByCommentId($comment_id, $user_blocked_ids = [], $abuse_report_comment_ids = [])
280
    {
310
    {
-
 
311
        $prototype = new Comment();
-
 
312
 
-
 
313
        $select = $this->sql->select(self::_TABLE);
-
 
314
        $select->where->equalTo('parent_id', $comment_id);
-
 
315
        $select->where->equalTo('status', Feed::STATUS_PUBLISHED);
-
 
316
        
-
 
317
        if($user_blocked_ids) {
-
 
318
            $select->where->notIn('user_id', $user_blocked_ids);
-
 
319
        }
-
 
320
        
-
 
321
        
281
        $prototype = new Comment();
322
        if($abuse_report_comment_ids) {
282
 
323
            $select->where->notIn('id', $abuse_report_comment_ids);
Línea 283... Línea 324...
283
        $select = $this->sql->select(self::_TABLE);
324
        }
284
        $select->where->equalTo('parent_id', $comment_id);
325