Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 6319 Rev 6521
Línea 96... Línea 96...
96
        $select->where->equalTo('status', Feed::STATUS_PUBLISHED);
96
        $select->where->equalTo('status', Feed::STATUS_PUBLISHED);
Línea 97... Línea 97...
97
 
97
 
98
        $record = $this->executeFetchOneArray($select);
98
        $record = $this->executeFetchOneArray($select);
99
        return $record['total'];
99
        return $record['total'];
-
 
100
    }
-
 
101
    
-
 
102
    
-
 
103
    /**
-
 
104
     *
-
 
105
     * @param int $my_coach_answer_id
-
 
106
     * @return int
-
 
107
     */
-
 
108
    public function fetchCountByMyCoachAnswerId($my_coach_answer_id)
-
 
109
    {
-
 
110
        $select = $this->sql->select(self::_TABLE);
-
 
111
        $select->columns(['total' => new Expression('COUNT(*)')]);
-
 
112
        $select->where->equalTo('my_coach_answer_id', $my_coach_answer_id);
-
 
113
        $select->where->equalTo('relational', Comment::RELATIONAL_MY_COACH);
-
 
114
        $select->where->equalTo('status', Feed::STATUS_PUBLISHED);
-
 
115
        
-
 
116
        $record = $this->executeFetchOneArray($select);
-
 
117
        return $record['total'];
-
 
118
    }
-
 
119
    
-
 
120
    
-
 
121
    
-
 
122
    
-
 
123
    /**
-
 
124
     *
-
 
125
     * @param int my_coach_question_id
-
 
126
     * @return int
-
 
127
     */
-
 
128
    public function fetchCountByMyCoachQuestionId($my_coach_question_id)
-
 
129
    {
-
 
130
        $selectIn = $this->sql->select(MyCoachAnswerMapper::_TABLE);
-
 
131
        $selectIn->columns(['id']);
-
 
132
        $selectIn->where->equalTo('question_id', $my_coach_question_id);
-
 
133
 
-
 
134
        $select = $this->sql->select(self::_TABLE);
-
 
135
        $select->columns(['total' => new Expression('COUNT(*)')]);
-
 
136
        $select->where->in('my_coach_answer_id', $selectIn);
-
 
137
        $select->where->equalTo('relational', Comment::RELATIONAL_MY_COACH);
-
 
138
        $select->where->equalTo('status', Feed::STATUS_PUBLISHED);
-
 
139
        
-
 
140
        $record = $this->executeFetchOneArray($select);
-
 
141
        return $record['total'];
-
 
142
    }
-
 
143
    
-
 
144
 
-
 
145
    
Línea 100... Línea 146...
100
    }
146
    
101
 
147
 
102
 
148
 
Línea 184... Línea 230...
184
        $select->where->equalTo('relational', Comment::RELATIONAL_KNOWLEDGE_AREA);
230
        $select->where->equalTo('relational', Comment::RELATIONAL_KNOWLEDGE_AREA);
185
        $select->where->IsNull('parent_id');
231
        $select->where->IsNull('parent_id');
186
        return $this->executeFetchAllObject($select, $prototype);
232
        return $this->executeFetchAllObject($select, $prototype);
187
    }
233
    }
Línea -... Línea 234...
-
 
234
 
188
 
235
    
-
 
236
    
-
 
237
    
-
 
238
    
-
 
239
    /**
-
 
240
     *
-
 
241
     * @param int $my_coach_answer_id
-
 
242
     * @return Comment[]
-
 
243
     */
-
 
244
    public function fetchAllPublishedByMyCoachAnswerId($my_coach_answer_id)
-
 
245
    {
-
 
246
        $prototype = new Comment();
-
 
247
        
-
 
248
        $select = $this->sql->select(self::_TABLE);
-
 
249
        $select->where->equalTo('my_coach_answer_id', $my_coach_answer_id);
-
 
250
        $select->where->equalTo('status', Feed::STATUS_PUBLISHED);
-
 
251
        $select->where->equalTo('relational', Comment::RELATIONAL_MY_COACH);
-
 
252
        $select->where->IsNull('parent_id');
-
 
253
        $select->order('added_on DESC');
-
 
254
        return $this->executeFetchAllObject($select, $prototype);
-
 
255
    }
-
 
256
    
189
 
257
    
190
    /**
258
    /**
191
     *
259
     *
192
     * @param int $post_id
260
     * @param int $post_id
193
     * @return Comment[]
261
     * @return Comment[]