Proyectos de Subversion LeadersLinked - Services

Rev

Rev 1 | Rev 283 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 192
Línea 94... Línea 94...
94
        //$select->getSqlString($this->adapter->platform);
94
        //$select->getSqlString($this->adapter->platform);
Línea 95... Línea 95...
95
        
95
        
96
        return $this->executeFetchOneObject($select, $prototype);
96
        return $this->executeFetchOneObject($select, $prototype);
Línea 97... Línea -...
97
    }
-
 
98
 
-
 
99
     /**
-
 
100
     * 
-
 
101
     * @param int $id
-
 
102
     * @return Feed
-
 
103
     */
-
 
104
    public function fetchOneNonDeleted($id)
-
 
105
    {
-
 
106
        $select = $this->sql->select(self::_TABLE);
-
 
107
        $select->where->equalTo('id', $id);
-
 
108
        $select->where->equalTo('type', Feed::TYPE_MYT_QUESTION);
97
    }
109
        $select->where->notEqualTo('status', Feed::STATUS_DELETED);
-
 
110
        
-
 
111
        $prototype = new Feed();
-
 
Línea 112... Línea 98...
112
        return $this->executeFetchOneObject($select, $prototype);
98
 
113
    }
99
 
114
    
100
    
115
    /**
101
    /**
Línea 245... Línea 231...
245
        
231
        
246
        
232
        
Línea 247... Línea -...
247
        return $paginator;
-
 
248
    }*/
-
 
249
    
-
 
250
    public function fetchFiveForoJoinTopic($group_id,$topic_type)
-
 
251
    {
-
 
252
        $prototype = new Feed();
-
 
253
        $select = $this->sql->select();
-
 
254
        $select->from(['f' => self::_TABLE]);
-
 
255
        $select->join(['t' => TopicMapper::_TABLE], 't.id = f.topic_id ', []);
-
 
256
        $select->where->equalTo('f.high_performance_group_id', $group_id);
-
 
257
        $select->where->equalTo('f.status', Feed::STATUS_PUBLISHED);
-
 
258
        $select->where->equalTo('f.type', Feed::TYPE_HPTG);
233
        return $paginator;
259
        $select->where->equalTo('t.type', $topic_type);
-
 
260
        $select->where->equalTo('t.status', Topic::STATUS_ACTIVE);
-
 
261
      
-
 
262
        $select->order('added_on DESC');      
-
 
263
 
-
 
264
        $hydrator   = new ObjectPropertyHydrator();
-
 
265
        $resultset  = new HydratingResultSet($hydrator, $prototype);
-
 
266
        
-
 
267
        $adapter = new DbSelect($select, $this->sql, $resultset);
-
 
268
        $paginator = new Paginator($adapter);
-
 
269
        $paginator->setItemCountPerPage(5);
-
 
270
        $paginator->setCurrentPageNumber(1);
-
 
271
        
-
 
272
        
234
    }*/
273
        return $paginator;
235
    
274
    }
236
  
275
    /**
237
    /**
276
     *
238
     *
Línea 420... Línea 382...
420
        $update->where->equalTo('id', $feed_id);
382
        $update->where->equalTo('id', $feed_id);
Línea 421... Línea 383...
421
        
383
        
422
        return $this->executeUpdate($update);
384
        return $this->executeUpdate($update);
Línea 423... Línea -...
423
    }
-
 
424
 
-
 
425
    /**
-
 
426
     *
-
 
427
     * @return Feed
-
 
428
     */
-
 
429
    public function fetchAllByMytQuestion()
-
 
430
    {
-
 
431
        $prototype = new Feed();
-
 
432
        
-
 
433
        $select = $this->sql->select(self::_TABLE);
-
 
434
        $select->where->equalTo('type', Feed::TYPE_MYT_QUESTION);
-
 
435
        $select->where->notEqualTo('status', Feed::STATUS_DELETED);
-
 
436
        $select->order('added_on DESC');     
-
 
437
        
-
 
438
        return $this->executeFetchAllObject($select, $prototype);
-
 
439
    }
-
 
440
 
-
 
441
    /**
-
 
442
     *
-
 
443
     * @return Feed
-
 
444
     */
-
 
445
    public function fetchAllByMytAnswer($related_feed)
-
 
446
    {
-
 
447
        $prototype = new Feed();
-
 
448
        
-
 
449
        $select = $this->sql->select(self::_TABLE);
-
 
450
        $select->where->equalTo('related_feed', $related_feed);
-
 
451
        $select->where->equalTo('type', Feed::TYPE_MYT_ANSWER);
-
 
452
        $select->where->notEqualTo('status', Feed::STATUS_DELETED);
-
 
453
        $select->order('title');
-
 
454
        
-
 
455
        return $this->executeFetchAllObject($select, $prototype);
-
 
456
    }
-
 
457
 
-
 
458
      /**
-
 
459
     *
-
 
460
     * @return Feed
-
 
461
     */
-
 
462
    public function fetchAllByTopicId($topic_id)
-
 
463
    {
-
 
464
        $prototype = new Feed();
-
 
465
        
-
 
466
        $select = $this->sql->select(self::_TABLE);
-
 
467
        $select->where->equalTo('topic_id', $topic_id);
-
 
468
        $select->order('title');
-
 
469
        
-
 
470
        return $this->executeFetchAllObject($select, $prototype);
-
 
471
    }
-
 
472
 
-
 
473
    /**
-
 
474
     *
-
 
475
     * @return Feed
-
 
476
     */
-
 
477
    public function fetchAllByMytAnswerComented()
-
 
478
    {
-
 
479
        $prototype = new Feed();
-
 
480
        
-
 
481
        $select = $this->sql->select(self::_TABLE);
-
 
482
        $select->where->equalTo('type', Feed::TYPE_MYT_ANSWER);
-
 
483
        $select->where->notEqualTo('status', Feed::STATUS_DELETED);
-
 
484
        $select->order('title');
-
 
485
        
-
 
486
        return $this->executeFetchAllObject($select, $prototype);
-
 
487
    }
-
 
488
 
-
 
489
     /**
-
 
490
     *
-
 
491
     * @return Feed
-
 
492
     */
-
 
493
    public function fetchAllByDevelop()
-
 
494
    {
-
 
495
        $prototype = new Feed();
-
 
496
        
-
 
497
        $select = $this->sql->select(self::_TABLE);
-
 
498
        $select->where->equalTo('type', Feed::TYPE_DC);
-
 
499
        $select->where->notEqualTo('status', Feed::STATUS_DELETED);
-
 
500
        $select->order('added_on DESC');
-
 
501
        
-
 
502
        return $this->executeFetchAllObject($select, $prototype);
-
 
503
    }
-
 
504
 
-
 
505
    public function fetchAllByDevelopContentPublished()
-
 
506
    {
-
 
507
        $prototype = new Feed();
-
 
508
 
-
 
509
        $select = $this->sql->select(self::_TABLE);
-
 
510
        $select->where->equalTo('type', Feed::TYPE_DC);
-
 
511
        $select->where->notEqualTo('status', Feed::STATUS_DELETED);
-
 
512
        $select->where->equalTo('status', Feed::STATUS_PUBLISHED);
-
 
513
        $select->order('added_on DESC');
-
 
514
 
-
 
515
        return $this->executeFetchAllObject($select, $prototype);
-
 
516
    }
-
 
517
    /**
-
 
518
     *
-
 
519
     * @return Feed
-
 
520
     */
-
 
521
    public function fetchAllByDevelopContentByCategoryId($id)
-
 
522
    {
-
 
523
        $prototype = new Feed();
-
 
524
 
-
 
525
        $select = $this->sql->select(self::_TABLE);
-
 
526
        $select->where->equalTo('type', Feed::TYPE_DC);
-
 
527
        $select->where->equalTo('topic_id', $id);
-
 
528
        $select->where->notEqualTo('status', Feed::STATUS_DELETED);
-
 
529
 
-
 
530
        $select->order('added_on DESC');
-
 
531
 
-
 
532
        return $this->executeFetchAllObject($select, $prototype);
-
 
533
    }
-
 
534
 
-
 
535
    /**
-
 
536
     *
-
 
537
     * @return Feed
-
 
538
     */
-
 
539
    public function fetchAllByDevelopContentPublishedByCategoryId($id)
-
 
540
    {
-
 
541
        $prototype = new Feed();
-
 
542
 
-
 
543
        $select = $this->sql->select(self::_TABLE);
-
 
544
        $select->where->equalTo('type', Feed::TYPE_DC);
-
 
545
        $select->where->equalTo('topic_id', $id);
-
 
546
        $select->where->notEqualTo('status', Feed::STATUS_DELETED);
-
 
547
        $select->where->equalTo('status', Feed::STATUS_PUBLISHED);
-
 
548
 
-
 
549
        $select->order('added_on DESC');
-
 
550
 
-
 
551
        return $this->executeFetchAllObject($select, $prototype);
-
 
552
    }
-
 
553
 
-
 
554
 
-
 
555
 
-
 
556
    /**
-
 
557
     *
-
 
558
     * @return Feed
-
 
559
     */
-
 
560
    public function fetchAllByDevelopAndCategoryIdCount($id)
-
 
561
    {
-
 
562
        $select = $this->sql->select(self::_TABLE);
-
 
563
        $select->columns(['total' => new Expression('COUNT(id)')]);
-
 
564
        $select->where->equalTo('topic_id', $id);
-
 
565
        $select->where->equalTo('type', Feed::TYPE_DC);
-
 
566
        $select->where->notEqualTo('status', Feed::STATUS_DELETED);
-
 
567
        $record = $this->executeFetchOneArray($select);
-
 
568
        return $record['total'];
-
 
569
    }
-
 
570
 
-
 
571
 
-
 
572
     /**
-
 
573
     *
-
 
574
     * @return Feed
-
 
575
     */
-
 
576
    public function fetchAllByDevelopInternContent()
-
 
577
    {
-
 
578
        $prototype = new Feed();
-
 
579
        
-
 
580
        $select = $this->sql->select(self::_TABLE);
-
 
581
        $select->where->equalTo('type', Feed::TYPE_DC);
-
 
582
        //$select->where->equalTo('link_media', 'cesa');
-
 
583
        $select->where->isNotNull('file_type');
-
 
584
        $select->where->notEqualTo('status', Feed::STATUS_DELETED);
-
 
585
        $select->order('title');
-
 
586
        //echo $insert->getSqlString($this->adapter->platform); exit;
-
 
587
        return $this->executeFetchAllObject($select, $prototype);
-
 
588
    }
-
 
589
 
-
 
590
      /**
-
 
591
     *
-
 
592
     * @return Feed
-
 
593
     */
-
 
594
    public function fetchAllByDevelopExternContent()
-
 
595
    {
-
 
596
        $prototype = new Feed();
-
 
597
        
-
 
598
        $select = $this->sql->select(self::_TABLE);
-
 
599
        $select->where->equalTo('type', Feed::TYPE_DC);
-
 
600
        $select->where->notEqualTo('status', Feed::STATUS_DELETED);
-
 
601
        $select->where->notEqualTo('link_media', 'cesa');
-
 
602
        $select->order('title');
-
 
603
        
-
 
604
        return $this->executeFetchAllObject($select, $prototype);
-
 
Línea 605... Línea 385...
605
    }
385
    }
606
    
386
 
607
    
387