Proyectos de Subversion LeadersLinked - Services

Rev

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

Rev 232 Rev 242
Línea 79... Línea 79...
79
        return $this->executeFetchAllArray($select);
79
        return $this->executeFetchAllArray($select);
80
    }
80
    }
Línea 81... Línea 81...
81
    
81
    
82
    /**
82
    /**
-
 
83
     *
-
 
84
     * @param int $feed_id
-
 
85
     * @return array
-
 
86
     */
-
 
87
    public function fetchAllByMyCoachQuestionId($my_coach_question_id)
-
 
88
    {
-
 
89
        $prototype = new ContentReaction();
-
 
90
        
-
 
91
        $select = $this->sql->select(self::_TABLE);
-
 
92
        $select->where->equalTo('question_id', $my_coach_question_id);
-
 
93
        $select->where->equalTo('relational', ContentReaction::RELATIONAL_MY_COACH);
-
 
94
        $select->order('added_on DESC');
-
 
95
        
-
 
96
        return $this->executeFetchAllObject($select, $prototype);
-
 
97
    }
-
 
98
    
-
 
99
    /**
83
     *
100
     *
84
     * @param int $my_coach_question_id
101
     * @param int $my_coach_question_id
85
     * @return array
102
     * @return array
86
     */
103
     */
87
    public function fetchCountByMyCoachQuestionId($my_coach_question_id)
104
    public function fetchCountByMyCoachQuestionId($my_coach_question_id)
Línea 101... Línea 118...
101
        return $record['total'];
118
        return $record['total'];
102
    }
119
    }
Línea 103... Línea 120...
103
    
120
    
104
    /**
121
    /**
-
 
122
     *
-
 
123
     * @param int $feed_id
-
 
124
     * @return array
-
 
125
     */
-
 
126
    public function fetchAllByMyCoachAnswerId($my_coach_answer_id)
-
 
127
    {
-
 
128
        $prototype = new ContentReaction();
-
 
129
        
-
 
130
        $select = $this->sql->select(self::_TABLE);
-
 
131
        $select->where->equalTo('my_coach_answer_id', $my_coach_answer_id);
-
 
132
        $select->where->equalTo('relational', ContentReaction::RELATIONAL_MY_COACH);
-
 
133
        $select->order('added_on DESC');
-
 
134
        
-
 
135
        return $this->executeFetchAllObject($select, $prototype);
-
 
136
    }
-
 
137
    
-
 
138
    /**
105
     *
139
     *
106
     * @param int $my_coach_answer_id
140
     * @param int $my_coach_answer_id
107
     * @return array
141
     * @return array
108
     */
142
     */
109
    public function fetchCountByMyCoachAnswerId($my_coach_answer_id)
143
    public function fetchCountByMyCoachAnswerId($my_coach_answer_id)
Línea 128... Línea 162...
128
        
162
        
129
        return $this->executeFetchAllArray($select);
163
        return $this->executeFetchAllArray($select);
130
    }
164
    }
Línea -... Línea 165...
-
 
165
     */
-
 
166
    
-
 
167
    /**
-
 
168
     *
-
 
169
     * @param int $feed_id
-
 
170
     * @return array
-
 
171
     */
-
 
172
    public function fetchAllByKnowledgeAreaId($knowledge_area_id)
-
 
173
    {
-
 
174
        $prototype = new ContentReaction();
-
 
175
        
-
 
176
        $select = $this->sql->select(self::_TABLE);
-
 
177
        $select->where->equalTo('knowledge_area_id', $knowledge_area_id);
-
 
178
        $select->where->equalTo('relational', ContentReaction::RELATIONAL_KNOWLEDGE_AREA);
-
 
179
        $select->order('added_on DESC');
-
 
180
        
-
 
181
        return $this->executeFetchAllObject($select, $prototype);
Línea 131... Línea 182...
131
     */
182
    }
132
    
183
    
133
    
184
    
134
    /**
185
    /**
Línea 201... Línea 252...
201
        return $this->executeFetchOneObject($select, $prototype);
252
        return $this->executeFetchOneObject($select, $prototype);
202
    }
253
    }
Línea 203... Línea 254...
203
    
254
    
204
    /**
255
    /**
-
 
256
     *
-
 
257
     * @param int $post_id
-
 
258
     * @return array
-
 
259
     */
-
 
260
    public function fetchAllByPostId($post_id)
-
 
261
    {
-
 
262
        $prototype = new ContentReaction();
-
 
263
        
-
 
264
        $select = $this->sql->select(self::_TABLE);
-
 
265
        $select->where->equalTo('post_id', $post_id);
-
 
266
        $select->where->equalTo('relational', ContentReaction::RELATIONAL_POST);
-
 
267
        $select->order('added_on DESC');
-
 
268
        
-
 
269
        return $this->executeFetchAllObject($select, $prototype);
-
 
270
    }
-
 
271
    
-
 
272
    /**
205
     *
273
     *
206
     * @param int $my_coach_answer_id
274
     * @param int $my_coach_answer_id
207
     * @param int $user_id
275
     * @param int $user_id
208
     * @return ContentReaction
276
     * @return ContentReaction
209
     */
277
     */
Línea 274... Línea 342...
274
     *
342
     *
275
     * @param int $my_coach_answer_id
343
     * @param int $my_coach_answer_id
276
     * @param int $user_id
344
     * @param int $user_id
277
     * @return boolean
345
     * @return boolean
278
     */
346
     */
279
    public function deleteByByMyCoachAnswerId($my_coach_answer_id, $user_id)
347
    public function deletesMyCoachAnswerId($my_coach_answer_id, $user_id)
280
    {
348
    {
281
        $delete = $this->sql->delete(self::_TABLE);
349
        $delete = $this->sql->delete(self::_TABLE);
282
        $delete->where->equalTo('my_coach_answer_id', $my_coach_answer_id);
350
        $delete->where->equalTo('my_coach_answer_id', $my_coach_answer_id);
283
        $delete->where->equalTo('user_id', $user_id);
351
        $delete->where->equalTo('user_id', $user_id);
284
        $delete->where->equalTo('relational', ContentReaction::RELATIONAL_MY_COACH);
352
        $delete->where->equalTo('relational', ContentReaction::RELATIONAL_MY_COACH);