Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 3471 Rev 4776
Línea 14... Línea 14...
14
use Laminas\Paginator\Adapter\DbSelect;
14
use Laminas\Paginator\Adapter\DbSelect;
Línea 15... Línea 15...
15
 
15
 
16
 
16
 
17
class RecruitmentSelectionInterviewMapper extends MapperCommon
17
class RecruitmentSelectionInterviewMapper extends MapperCommon
Línea 18... Línea 18...
18
{
18
{
19
    const _TABLE = 'tbl_recruitment_selection_candidate_interviews';
19
    const _TABLE = 'tbl_recruitment_selection_interviews';
20
    
20
    
21
    /**
21
    /**
Línea 75... Línea 75...
75
        
75
        
76
        return $this->executeFetchOneObject($select, $prototype);
76
        return $this->executeFetchOneObject($select, $prototype);
Línea 77... Línea -...
77
    }
-
 
78
   
-
 
79
    
-
 
80
    /**
-
 
81
     *
-
 
82
     * @param int $company_id
-
 
83
     * @return RecruitmentSelectionInterview
-
 
84
     */
-
 
85
    public function fetchAllByCompanyId($company_id)
-
 
86
    {
-
 
87
        $prototype = new RecruitmentSelectionInterview();
-
 
88
        
-
 
89
        $select = $this->sql->select(self::_TABLE);
-
 
90
        $select->where->equalTo('company_id', $company_id);
-
 
91
        $select->order('name');
-
 
92
        
-
 
93
        return $this->executeFetchAllObject($select, $prototype);
-
 
94
    }
-
 
95
 
-
 
96
     /**
-
 
97
     *
-
 
98
     * @param int $candidate_id
-
 
99
     * @return RecruitmentSelectionInterview
-
 
100
     */
-
 
101
    public function fetchAllByVacancyId($vacancy_id)
-
 
102
    {
-
 
103
        $prototype = new RecruitmentSelectionInterview();
-
 
104
        
-
 
105
        $select = $this->sql->select(self::_TABLE);
-
 
106
        $select->where->equalTo('vacancy_id', $vacancy_id);
-
 
107
        $select->order('first_name');
-
 
108
        
-
 
109
        return $this->executeFetchAllObject($select, $prototype);
-
 
110
    }
-
 
111
 
-
 
112
     /**
-
 
113
     *
-
 
114
     * @param int $company_id
-
 
115
     * @return RecruitmentSelectionInterview
-
 
116
     */
-
 
117
    public function fetchOneByCompanyId($company_id)
-
 
118
    {
-
 
119
        $prototype = new RecruitmentSelectionInterview();
-
 
120
        
-
 
121
        $select = $this->sql->select(self::_TABLE);
-
 
122
        $select->where->equalTo('company_id', $company_id);
-
 
123
        $select->order('name');
-
 
124
        
-
 
125
        return $this->executeFetchOneObject($select, $prototype);
-
 
126
    }
-
 
127
 
-
 
128
     /**
-
 
129
     *
-
 
130
     * @param int $company_id
-
 
131
     * @param int $vacancy_id
-
 
132
     * @return RecruitmentSelectionVacancy[]
-
 
133
     */
-
 
134
    public function fetchAllByCompanyIdAndVacancyId($company_id, $vacancy_id)
-
 
135
    {
-
 
136
        $prototype = new RecruitmentSelectionVacancy();
-
 
137
        
-
 
138
        $select = $this->sql->select(self::_TABLE);
-
 
139
        $select->where->equalTo('company_id', $company_id);
-
 
140
        $select->where->equalTo('vacancy_id', $vacancy_id);
-
 
141
        $select->order(['name']);
-
 
142
        
-
 
143
        //echo $select->getSqlString($this->adapter->platform); exit;
-
 
144
        
-
 
145
        return $this->executeFetchAllObject($select, $prototype);
-
 
146
    }
-
 
147
    
-
 
148
    /**
-
 
149
     * @param int $vacancy_id
-
 
150
     * @param int $candidate_id
-
 
151
     * @return RecruitmentSelectionInterview
-
 
152
     */
-
 
153
    public function fetchOneByCandidateIdAndVacancyId($candidate_id, $vacancy_id)
-
 
154
    {
-
 
155
        $prototype = new RecruitmentSelectionInterview();
-
 
156
        
-
 
157
        $select = $this->sql->select(self::_TABLE);
-
 
158
        $select->where->equalTo('candidate_id', $candidate_id);
-
 
159
        $select->where->equalTo('vacancy_id', $vacancy_id);
-
 
160
        $select->order(['uuid']);
-
 
161
                
-
 
162
        return $this->executeFetchOneObject($select, $prototype);
-
 
163
    }
-
 
164
 
-
 
165
        /**
-
 
166
     * @param int $vacancy_id
-
 
167
     * @param int $candidate_id
-
 
168
     * @return RecruitmentSelectionInterview
-
 
169
     */
-
 
170
    public function fetchAllByCandidateIdAndVacancyId($candidate_id, $vacancy_id)
-
 
171
    {
-
 
172
        $prototype = new RecruitmentSelectionInterview();
-
 
173
        
-
 
174
        $select = $this->sql->select(self::_TABLE);
-
 
175
        $select->where->equalTo('candidate_id', $candidate_id);
77
    }
176
        $select->where->equalTo('vacancy_id', $vacancy_id);
-
 
177
        $select->order(['uuid']);
-
 
Línea 178... Línea 78...
178
                
78
   
179
        return $this->executeFetchAllObject($select, $prototype);
79
    
180
    }
80
   
181
    
81
    
182
    /**
82
    /**
183
     * 
83
     * 
184
     * @param RecruitmentSelectionInterviewMapper $form
84
     * @param RecruitmentSelectionInterviewMapper $record
185
     * @return boolean
85
     * @return boolean
186
     */
86
     */
187
    public function insert($form)
87
    public function insert($record)
Línea 188... Línea 88...
188
    {
88
    {
189
        $hydrator = new ObjectPropertyHydrator();
89
        $hydrator = new ObjectPropertyHydrator();
Línea 190... Línea 90...
190
        $values = $hydrator->extract($form);
90
        $values = $hydrator->extract($record);
Línea 191... Línea 91...
191
        $values = $this->removeEmpty($values);
91
        $values = $this->removeEmpty($values);
192
        
92
        
193
        $insert = $this->sql->insert(self::_TABLE);
93
        $insert = $this->sql->insert(self::_TABLE);
194
        $insert->values($values);
94
        $insert->values($values);
195
 
95
 
196
       // echo $insert->getSqlString($this->adapter->platform); exit;        
96
       // echo $insert->getSqlString($this->adapter->platform); exit;        
Línea 197... Línea 97...
197
        
97
        
198
        $result = $this->executeInsert($insert);
98
        $result = $this->executeInsert($insert);
199
        if($result) {
99
        if($result) {
200
            $form->id = $this->lastInsertId;
100
            $record->id = $this->lastInsertId;
201
        }
101
        }
202
        return $result;
102
        return $result;
203
    }
103
    }
204
    
104
    
205
    /**
105
    /**
206
     *
106
     *
Línea 207... Línea 107...
207
     * @param RecruitmentSelectionInterviewMapper $form
107
     * @param RecruitmentSelectionInterviewMapper $record
208
     * @return boolean
108
     * @return boolean
209
     */
109
     */
Línea 210... Línea 110...
210
    public function update($form)
110
    public function update($record)
211
    {
111
    {
Línea 212... Línea 112...
212
        $hydrator = new ObjectPropertyHydrator();
112
        $hydrator = new ObjectPropertyHydrator();
213
        $values = $hydrator->extract($form);
113
        $values = $hydrator->extract($record);
214
        $values = $this->removeEmpty($values);
114
        $values = $this->removeEmpty($values);
215
        
115
        
216
        $update = $this->sql->update(self::_TABLE);
116
        $update = $this->sql->update(self::_TABLE);
217
        $update->set($values);
117
        $update->set($values);
218
        $update->where->equalTo('id', $form->id);
118
        $update->where->equalTo('id', $record->id);
219
        
119
        
220
        return $this->executeUpdate($update); 
120
        return $this->executeUpdate($update); 
Línea 221... Línea 121...
221
    }
121
    }
222
    
122
    
Línea 223... Línea 123...
223
    /**
123
    /**
224
     *
-
 
225
     * @param int $form_id
-
 
226
     * @return boolean
-
 
227
     */
-
 
228
    public function delete($form_id)
-
 
229
    {
-
 
230
        $delete = $this->sql->delete(self::_TABLE);
-
 
231
        $delete->where->equalTo('id', $form_id);
-
 
232
        
-
 
233
        return $this->executeDelete($delete);
124
     *
234
    }
125
     * @param int $record_id
235
    
126
     * @return boolean
236
    
127
     */
237
    /**
128
    public function delete($id)
Línea 265... Línea 156...
265
        $paginator->setItemCountPerPage($records_per_page);
156
        $paginator->setItemCountPerPage($records_per_page);
266
        $paginator->setCurrentPageNumber($page);
157
        $paginator->setCurrentPageNumber($page);
Línea 267... Línea 158...
267
        
158
        
268
        
159
        
Línea 269... Línea 160...
269
        return $paginator;
160
        return $paginator;
270
    }
161
    }*/