Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 1 Rev 2392
Línea 13... Línea 13...
13
use Laminas\Paginator\Adapter\DbSelect;
13
use Laminas\Paginator\Adapter\DbSelect;
Línea 14... Línea 14...
14
 
14
 
15
use LeadersLinked\Model\DeviceHistory;
15
use LeadersLinked\Model\DeviceHistory;
16
use LeadersLinked\Mapper\Common\MapperCommon;
16
use LeadersLinked\Mapper\Common\MapperCommon;
-
 
17
use Laminas\Hydrator\ArraySerializableHydrator;
Línea 17... Línea 18...
17
use Laminas\Hydrator\ArraySerializableHydrator;
18
use LeadersLinked\Model\Device;
18
 
19
 
Línea 97... Línea 98...
97
        }
98
        }
98
        return;
99
        return;
Línea 99... Línea 100...
99
        
100
        
Línea -... Línea 101...
-
 
101
    }
-
 
102
    
-
 
103
    /**
-
 
104
     *
-
 
105
     * @param int $application_id
-
 
106
     * @param int $user_id
-
 
107
     * @return Device
-
 
108
     */
-
 
109
    public function fetchLastDeviceByApplicationIdAndUserId($application_id, $user_id)
-
 
110
    
-
 
111
    {
-
 
112
        $select = $this->sql->select();
-
 
113
        $select->columns([]);
-
 
114
        $select->from(['tb1' => DeviceHistoryMapper::_TABLE  ]);
-
 
115
        $select->join(['tb2' => DeviceMapper::_TABLE], 'tb1.device_id  = tb2.id');
-
 
116
        $select->where->equalTo('tb2.application_id', $application_id);
-
 
117
        $select->where->equalTo('tb1.user_id', $user_id);
-
 
118
        $select->order('tb1.updated_on  desc');
-
 
119
        $select->limit(1);
-
 
120
        
-
 
121
        $prototype = new Device();
-
 
122
        
-
 
123
        return $this->executeFetchOneObject($select, $prototype);
-
 
124
        
Línea 100... Línea 125...
100
    }
125
    }
101
    
126
    
102
   
127