Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 6951 Rev 7093
Línea 66... Línea 66...
66
     * @return JobDescription[]
66
     * @return JobDescription[]
67
     */
67
     */
68
    public function fetchAllByDefault() {
68
    public function fetchAllByDefault() {
69
        $select = $this->sql->select(self::_TABLE);
69
        $select = $this->sql->select(self::_TABLE);
70
        $select->where->isNull('company_id');
70
        $select->where->isNull('company_id');
71
        $select->where->equalTo('status', JobDescription::STATUS_ACTIVE);
-
 
72
        $select->order('name');
71
        $select->order('name');
Línea 73... Línea 72...
73
        
72
        
74
        
73
        
Línea 108... Línea 107...
108
    /**
107
    /**
109
     *
108
     *
110
     * @param int $company_id
109
     * @param int $company_id
111
     * @return JobDescription
110
     * @return JobDescription
112
     */
111
     */
113
    public function fetchAllByCompanyId($company_id) {
112
    public function fetchAllByCompanyId($company_id) 
-
 
113
    {
114
        $select = $this->sql->select(self::_TABLE);
114
        $select = $this->sql->select(self::_TABLE);
115
        $select->where->equalTo('company_id', $company_id);
115
        $select->where->equalTo('company_id', $company_id);
116
        $select->order('name');
116
        $select->order('name');
Línea 117... Línea 117...
117
 
117
 
118
        $prototype = new JobDescription();
118
        $prototype = new JobDescription();
119
        return $this->executeFetchAllObject($select, $prototype);
119
        return $this->executeFetchAllObject($select, $prototype);
-
 
120
    }
-
 
121
    
Línea 120... Línea 122...
120
    }
122
 
121
 
123
 
122
    /**
124
    /**
-
 
125
     *
-
 
126
     * @param int $company_id
-
 
127
     * @param string $search
-
 
128
     * @return JobDescription
-
 
129
     */
-
 
130
    public function fetchAllByCompanyIdAndSearch($company_id, $search) {
-
 
131
        $select = $this->sql->select(self::_TABLE);
-
 
132
        $select->where->equalTo('company_id', $company_id);
-
 
133
        $select->where->like('name', '%' . $search . '%');
-
 
134
        $select->order('name');
-
 
135
        
-
 
136
        $prototype = new JobDescription();
-
 
137
        return $this->executeFetchAllObject($select, $prototype);
-
 
138
    }
-
 
139
    
-
 
140
    
-
 
141
    /**
123
     *
142
     *
124
     * @param int $company_id
143
     * @param int $company_id
125
     * @return JobDescription
144
     * @return JobDescription
126
     */
145
     */
127
    public function fetchAllActiveByCompanyId($company_id) {
146
    public function fetchAllActiveByCompanyId($company_id) {
Línea 252... Línea 271...
252
        $paginator->setCurrentPageNumber($page);
271
        $paginator->setCurrentPageNumber($page);
Línea 253... Línea 272...
253
 
272
 
254
 
273
 
-
 
274
        return $paginator;
-
 
275
    }
Línea 255... Línea 276...
255
        return $paginator;
276
 
256
    }
277
    
257
    
278
    
Línea 336... Línea 357...
336
    /**
357
    /**
337
     *
358
     *
338
     * @param JobDescription $jobDescription
359
     * @param JobDescription $jobDescription
339
     * @return boolean
360
     * @return boolean
340
     */
361
     */
341
    public function insert($jobDescription) {
362
    public function insert($jobDescription) 
-
 
363
    {
342
        $hydrator = new ObjectPropertyHydrator();
364
        $hydrator = new ObjectPropertyHydrator();
343
        $values = $hydrator->extract($jobDescription);
365
        $values = $hydrator->extract($jobDescription);
344
        $values = $this->removeEmpty($values);
366
        $values = $this->removeEmpty($values);
Línea 345... Línea 367...
345
        
367
        
Línea 346... Línea -...
346
        $values['job_description_id_boss'] = !empty($values['job_description_id_boss']) ? $values['job_description_id_boss'] : null;
-
 
347
 
368
        $values['job_description_id_boss'] = !empty($values['job_description_id_boss']) ? $values['job_description_id_boss'] : null;
348
 
369
 
Línea 349... Línea -...
349
        $insert = $this->sql->insert(self::_TABLE);
-
 
350
        $insert->values($values);
-
 
351
 
-
 
352
        //echo $insert->getSqlString($this->adapter->platform); exit;
370
        $insert = $this->sql->insert(self::_TABLE);
353
 
371
        $insert->values($values);
354
 
372
 
355
        $result = $this->executeInsert($insert);
373
        $result = $this->executeInsert($insert);
356
        if ($result) {
374
        if ($result) {
Línea 362... Línea 380...
362
    /**
380
    /**
363
     *
381
     *
364
     * @param JobDescription $jobDescription
382
     * @param JobDescription $jobDescription
365
     * @return boolean
383
     * @return boolean
366
     */
384
     */
367
    public function update($jobDescription) {
385
    public function update($jobDescription) 
-
 
386
    {
368
        $hydrator = new ObjectPropertyHydrator();
387
        $hydrator = new ObjectPropertyHydrator();
369
        $values = $hydrator->extract($jobDescription);
388
        $values = $hydrator->extract($jobDescription);
370
        $values = $this->removeEmpty($values);
389
        $values = $this->removeEmpty($values);
Línea 371... Línea 390...
371
 
390
 
Línea 381... Línea 400...
381
    /**
400
    /**
382
     *
401
     *
383
     * @param JobDescription $jobDescription
402
     * @param JobDescription $jobDescription
384
     * @return boolean
403
     * @return boolean
385
     */
404
     */
386
    public function delete($jobDescription) {
405
    public function delete($jobDescription) 
-
 
406
    {
387
        $delete = $this->sql->delete(self::_TABLE);
407
        $delete = $this->sql->delete(self::_TABLE);
388
        $delete->where->equalTo('id', $jobDescription->id);
408
        $delete->where->equalTo('id', $jobDescription->id);
Línea 389... Línea 409...
389
 
409
 
390
        return $this->executeDelete($delete);
410
        return $this->executeDelete($delete);