Proyectos de Subversion LeadersLinked - Services

Rev

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

Rev 192 Rev 203
Línea 82... Línea 82...
82
        return $this->executeFetchOneObject($select, $prototype);
82
        return $this->executeFetchOneObject($select, $prototype);
83
    }
83
    }
Línea 84... Línea 84...
84
    
84
    
85
    /**
85
    /**
86
     *
86
     *
87
     * @param string $search
87
     * @param int $user_reporting_id
88
     * @param int $page
88
     * @param int $page
89
     * @param int $records_per_page
89
     * @param int $records_per_page
90
     * @param string $order_field
90
     * @param string $order_field
91
     * @param string $order_direction
91
     * @param string $order_direction
92
     * @return Paginator
92
     * @return Paginator
93
     */
93
     */
94
    public function fetchAllDataTable($search, $page = 1, $records_per_page = 10, $order_field= 'name', $order_direction = 'ASC')
94
    public function fetchAllDataTableByUserReportingId($user_reporting_id, $page = 1, $records_per_page = 10, $order_field= 'id', $order_direction = 'DESC')
95
    {
95
    {
96
        $prototype = new AbuseReport();
96
        $prototype = new AbuseReport();
97
        $select = $this->sql->select(self::_TABLE);
-
 
98
        
-
 
99
        if($search) {
97
        $select = $this->sql->select(self::_TABLE);
100
            //$select->where->like('name', '%' . $search . '%');
-
 
101
        }
98
        $select->where->equalTo('user_reporting_id', $user_reporting_id);
Línea 102... Línea 99...
102
        $select->order($order_field . ' ' . $order_direction);
99
        $select->order($order_field . ' ' . $order_direction);
103
        
100
        
Línea 121... Línea 118...
121
     * @param int $records_per_page
118
     * @param int $records_per_page
122
     * @param string $order_field
119
     * @param string $order_field
123
     * @param string $order_direction
120
     * @param string $order_direction
124
     * @return Paginator
121
     * @return Paginator
125
     */
122
     */
126
    public function fetchAllDataTableByUserReportingId($user_reporting_id, $search, $page = 1, $records_per_page = 10, $order_field= 'name', $order_direction = 'ASC')
123
    public function fetchAllDataTable( $search, $page = 1, $records_per_page = 10, $order_field= 'name', $order_direction = 'ASC')
127
    {
124
    {
128
        $prototype = new AbuseReport();
125
        $prototype = new AbuseReport();
129
        $select = $this->sql->select(self::_TABLE);
126
        $select = $this->sql->select(self::_TABLE);
130
        $select->where->equalTo('user_reporting_id', $user_reporting_id);
127
        $select->where->equalTo('user_reporting_id', $user_reporting_id);
Línea 178... Línea 175...
178
     */
175
     */
179
    public function insert($abuseReport)
176
    public function insert($abuseReport)
180
    {
177
    {
181
        $hydrator = new ObjectPropertyHydrator();
178
        $hydrator = new ObjectPropertyHydrator();
182
        $values = $hydrator->extract($abuseReport);
179
        $values = $hydrator->extract($abuseReport);
-
 
180
        $values = $this->removeEmpty($values);
Línea 183... Línea 181...
183
        
181
        
184
        $insert = $this->sql->insert(self::_TABLE);
182
        $insert = $this->sql->insert(self::_TABLE);
Línea 201... Línea 199...
201
     */
199
     */
202
    public function update($abuseReport)
200
    public function update($abuseReport)
203
    {
201
    {
204
        $hydrator = new ObjectPropertyHydrator();
202
        $hydrator = new ObjectPropertyHydrator();
205
        $values = $hydrator->extract($abuseReport);
203
        $values = $hydrator->extract($abuseReport);
-
 
204
        $values = $this->removeEmpty($values);
Línea 206... Línea 205...
206
        
205
        
207
        $update = $this->sql->update(self::_TABLE);
206
        $update = $this->sql->update(self::_TABLE);
208
        $update->set($values);
207
        $update->set($values);