Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 1684 Rev 4808
Línea 72... Línea 72...
72
    public function fetchCountCommentByFeedId($feed_id)
72
    public function fetchCountCommentByFeedId($feed_id)
73
    {
73
    {
74
        $select = $this->sql->select(self::_TABLE);
74
        $select = $this->sql->select(self::_TABLE);
75
        $select->columns(['total' => new Expression('COUNT(*)') ]);
75
        $select->columns(['total' => new Expression('COUNT(*)') ]);
76
        $select->where->equalTo('feed_id', $feed_id);
76
        $select->where->equalTo('feed_id', $feed_id);
-
 
77
        $select->where->equalTo('relational', Comment::RELATIONAL_FEED);
-
 
78
        $select->where->equalTo('status', Feed::STATUS_PUBLISHED);
-
 
79
        
-
 
80
        $record = $this->executeFetchOneArray($select);
-
 
81
        return $record['total'];
-
 
82
    }
-
 
83
    
-
 
84
    /**
-
 
85
     *
-
 
86
     * @param int $post_id
-
 
87
     * @return int
-
 
88
     */
-
 
89
    public function fetchCountCommentByPostId($post_id)
-
 
90
    {
-
 
91
        $select = $this->sql->select(self::_TABLE);
-
 
92
        $select->columns(['total' => new Expression('COUNT(*)') ]);
-
 
93
        $select->where->equalTo('post_id', $post_id);
-
 
94
        $select->where->equalTo('relational', Comment::RELATIONAL_POST);
-
 
95
        
77
        $select->where->equalTo('status', Feed::STATUS_PUBLISHED);
96
        $select->where->equalTo('status', Feed::STATUS_PUBLISHED);
Línea 78... Línea 97...
78
        
97
        
79
        $record = $this->executeFetchOneArray($select);
98
        $record = $this->executeFetchOneArray($select);
80
        return $record['total'];
99
        return $record['total'];
Línea 90... Línea 109...
90
    {
109
    {
91
        $prototype = new Comment();
110
        $prototype = new Comment();
Línea 92... Línea 111...
92
        
111
        
93
        $select = $this->sql->select(self::_TABLE);
112
        $select = $this->sql->select(self::_TABLE);
-
 
113
        $select->where->equalTo('feed_id', $feed_id);
-
 
114
        $select->where->equalTo('relational', Comment::RELATIONAL_FEED);
-
 
115
        
-
 
116
        return $this->executeFetchAllObject($select, $prototype);
-
 
117
    }
-
 
118
    
-
 
119
    /**
-
 
120
     *
-
 
121
     * @param int $post_id
-
 
122
     * @return Comment[]
-
 
123
     */
-
 
124
    public function fetchAllByPostId($post_id)
-
 
125
    {
-
 
126
        $prototype = new Comment();
-
 
127
        
-
 
128
        $select = $this->sql->select(self::_TABLE);
-
 
129
        $select->where->equalTo('post_id', $post_id);
Línea 94... Línea 130...
94
        $select->where->equalTo('feed_id', $feed_id);
130
        $select->where->equalTo('relational', Comment::RELATIONAL_POST);
95
        
131
        
Línea 96... Línea 132...
96
        return $this->executeFetchAllObject($select, $prototype);
132
        return $this->executeFetchAllObject($select, $prototype);
Línea 106... Línea 142...
106
        $prototype = new Comment();
142
        $prototype = new Comment();
Línea 107... Línea 143...
107
        
143
        
108
        $select = $this->sql->select(self::_TABLE);
144
        $select = $this->sql->select(self::_TABLE);
109
        $select->where->equalTo('feed_id', $feed_id);
145
        $select->where->equalTo('feed_id', $feed_id);
-
 
146
        $select->where->equalTo('status', Feed::STATUS_PUBLISHED);
-
 
147
        $select->where->equalTo('relational', Comment::RELATIONAL_FEED);
-
 
148
        $select->where->IsNull('parent_id');
-
 
149
        return $this->executeFetchAllObject($select, $prototype);
-
 
150
    }
-
 
151
    
-
 
152
    
-
 
153
    /**
-
 
154
     *
-
 
155
     * @param int $post_id
-
 
156
     * @return Comment[]
-
 
157
     */
-
 
158
    public function fetchAllPublishedByPostId($post_id)
-
 
159
    {
-
 
160
        $prototype = new Comment();
-
 
161
        
-
 
162
        $select = $this->sql->select(self::_TABLE);
-
 
163
        $select->where->equalTo('post_id', $post_id);
-
 
164
        $select->where->equalTo('status', Feed::STATUS_PUBLISHED);
110
        $select->where->equalTo('status', Feed::STATUS_PUBLISHED);
165
        $select->where->equalTo('relational', Comment::RELATIONAL_POST);
111
        $select->where->IsNull('parent_id');
166
        $select->where->IsNull('parent_id');
112
        return $this->executeFetchAllObject($select, $prototype);
167
        return $this->executeFetchAllObject($select, $prototype);
-
 
168
    }
113
    }
169
    
114
    public function fetchAllPublishedByCommentId($comment_id)
170
    public function fetchAllPublishedByCommentId($comment_id)
115
    {
171
    {
Línea 116... Línea 172...
116
        $prototype = new Comment();
172
        $prototype = new Comment();