Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 5775 Rev 6056
Línea 59... Línea 59...
59
        
59
        
60
        return $this->executeFetchAllArray($select);
60
        return $this->executeFetchAllArray($select);
Línea -... Línea 61...
-
 
61
    }
-
 
62
    
-
 
63
    
-
 
64
    
-
 
65
    /**
-
 
66
     *
-
 
67
     * @param int $knowledge_area_id
-
 
68
     * @return array
-
 
69
     */
-
 
70
    public function fetchCountContentReactionsByKnowledgeAreaId($knowledge_area_id)
-
 
71
    {
-
 
72
        $select = $this->sql->select(self::_TABLE);
-
 
73
        $select->columns(['total' => new Expression('COUNT(*)'), 'reaction']);
-
 
74
        $select->where->equalTo('knowledge_area_id', $knowledge_area_id);
-
 
75
        $select->group('reaction');
-
 
76
        
-
 
77
        return $this->executeFetchAllArray($select);
61
    }
78
    }
62
    
79
    
63
    
80
    
64
    /**
81
    /**
65
     *
82
     *
Línea 110... Línea 127...
110
        $prototype = new ContentReaction();
127
        $prototype = new ContentReaction();
111
        return $this->executeFetchOneObject($select, $prototype);
128
        return $this->executeFetchOneObject($select, $prototype);
112
    }
129
    }
Línea 113... Línea 130...
113
    
130
    
-
 
131
    /**
-
 
132
     *
-
 
133
     * @param int $knowledge_area_id
-
 
134
     * @param int $user_id
-
 
135
     * @return ContentReaction
-
 
136
     */
-
 
137
    public function fetchOneByKnowledgeAreaIdAndUserId($knowledge_area_id, $user_id)
-
 
138
    {
-
 
139
        $select = $this->sql->select(self::_TABLE);
-
 
140
        $select->where->equalTo('knowledge_area_id', $knowledge_area_id);
-
 
141
        $select->where->equalTo('user_id', $user_id);
-
 
142
        $select->where->equalTo('relational', ContentReaction::RELATIONAL_KNOWLEDGE_AREA);
-
 
143
        
-
 
144
        $prototype = new ContentReaction();
-
 
145
        return $this->executeFetchOneObject($select, $prototype);
-
 
146
    }
-
 
147
    
114
    /**
148
    /**
115
     * 
149
     * 
116
     * @param int $feed_id
150
     * @param int $feed_id
117
     * @param int $user_id
151
     * @param int $user_id
118
     * @return boolean
152
     * @return boolean
Línea 125... Línea 159...
125
        $delete->where->equalTo('relational', ContentReaction::RELATIONAL_FEED);
159
        $delete->where->equalTo('relational', ContentReaction::RELATIONAL_FEED);
Línea 126... Línea 160...
126
        
160
        
127
        return $this->executeDelete($delete);
161
        return $this->executeDelete($delete);
Línea -... Línea 162...
-
 
162
    }
-
 
163
    
-
 
164
    /**
-
 
165
     *
-
 
166
     * @param int $knowledge_area_id
-
 
167
     * @param int $user_id
-
 
168
     * @return boolean
-
 
169
     */
-
 
170
    public function deleteByKnowledgeAreaIdAndUserId($knowledge_area_id, $user_id)
-
 
171
    {
-
 
172
        $delete = $this->sql->delete(self::_TABLE);
-
 
173
        $delete->where->equalTo('knowledge_area_id', $knowledge_area_id);
-
 
174
        $delete->where->equalTo('user_id', $user_id);
-
 
175
        $delete->where->equalTo('relational', ContentReaction::RELATIONAL_KNOWLEDGE_AREA);
-
 
176
        
-
 
177
        return $this->executeDelete($delete);
Línea 128... Línea 178...
128
    }
178
    }
129
    
179
    
130
    
180
    
131
    /**
181
    /**