Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 3138 Rev 6388
Línea 25... Línea 25...
25
use LeadersLinked\Model\Message;
25
use LeadersLinked\Model\Message;
26
use LeadersLinked\Model\Connection;
26
use LeadersLinked\Model\Connection;
27
use LeadersLinked\Model\Notification;
27
use LeadersLinked\Model\Notification;
28
use LeadersLinked\Mapper\UserExperienceMapper;
28
use LeadersLinked\Mapper\UserExperienceMapper;
29
use Laminas\Db\Sql\Select;
29
use Laminas\Db\Sql\Select;
30
use LeadersLinked\Mapper\UtilMapper;
-
 
-
 
30
 
Línea 31... Línea 31...
31
 
31
 
32
class UserNotification
32
class UserNotification
33
{
33
{
34
    const NOTIFICATION_TYPE_UNREAD = 'unread';
34
    const NOTIFICATION_TYPE_UNREAD = 'unread';
Línea 142... Línea 142...
142
     * @return string
142
     * @return string
143
     */
143
     */
144
    public function getNotifications($currentPage = 1, $notification_type = self::NOTIFICATION_TYPE_REGULAR) 
144
    public function getNotifications($currentPage = 1, $notification_type = self::NOTIFICATION_TYPE_REGULAR) 
145
    {
145
    {
Línea 146... Línea -...
146
        
-
 
147
        $utilMapper = UtilMapper::getInstance($this->adapter);
-
 
-
 
146
        
-
 
147
       
Línea 148... Línea 148...
148
        $now = $utilMapper->getDatebaseNow();
148
        
Línea 149... Línea 149...
149
        
149
        
-
 
150
        $content = '';
-
 
151
 
150
        $content = '';
152
        $queryMapper = QueryMapper::getInstance($this->adapter);
151
 
153
        $now = $queryMapper->getDatebaseNow();
152
        $queryMapper = QueryMapper::getInstance($this->adapter);
154
        
153
        $select = $queryMapper->getSql()->select(NotificationMapper::_TABLE);
155
        $select = $queryMapper->getSql()->select(NotificationMapper::_TABLE);
154
        $select->where->equalTo('user_id', $this->session_user_id);
156
        $select->where->equalTo('user_id', $this->session_user_id);
Línea 338... Línea 340...
338
     * @param int $currentPage
340
     * @param int $currentPage
339
     * @return array
341
     * @return array
340
     */
342
     */
341
    public function getMessages(int $currentPage = 1) 
343
    public function getMessages(int $currentPage = 1) 
342
    {
344
    {
343
        $utilMapper = UtilMapper::getInstance($this->adapter);
-
 
344
        $now = $utilMapper->getDatebaseNow();
-
 
-
 
345
       
-
 
346
        
Línea 345... Línea 347...
345
        
347
        
-
 
348
        $queryMapper = QueryMapper::getInstance($this->adapter);
-
 
349
        $now = $queryMapper->getDatebaseNow();
346
        $queryMapper = QueryMapper::getInstance($this->adapter);
350
        
347
        $select = $queryMapper->getSql()->select(MessageMapper::_TABLE);
351
        $select = $queryMapper->getSql()->select(MessageMapper::_TABLE);
348
        $select->where->equalTo('user_id', $this->session_user_id)->and->equalTo('receiver_status', Message::STATUS_NORMAL); 
352
        $select->where->equalTo('user_id', $this->session_user_id)->and->equalTo('receiver_status', Message::STATUS_NORMAL); 
349
        $select->group('conversation_id');
353
        $select->group('conversation_id');