Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 4113 Rev 6951
Línea 252... Línea 252...
252
        $paginator->setCurrentPageNumber($page);
252
        $paginator->setCurrentPageNumber($page);
Línea 253... Línea 253...
253
 
253
 
254
 
254
 
-
 
255
        return $paginator;
-
 
256
    }
-
 
257
    
-
 
258
    
-
 
259
    /**
-
 
260
     *
-
 
261
     * @return JobDescription[]
-
 
262
     */
-
 
263
    public function fetchAllDefaultOrderByPositionName()
-
 
264
    {
-
 
265
        $select = $this->sql->select(self::_TABLE);
-
 
266
        $select->order('job_description_id_boss, position, name');
-
 
267
        
-
 
268
        $prototype = new JobDescription();
-
 
269
        return $this->executeFetchAllObject($select, $prototype);
-
 
270
    }
-
 
271
    
-
 
272
    
-
 
273
    /**
-
 
274
     *
-
 
275
     * @param int $companyId
-
 
276
     * @return JobDescription[]
-
 
277
     */
-
 
278
    public function fetchAllByCompanyIdOrderByPositionName($companyId)
-
 
279
    {
-
 
280
        $select = $this->sql->select(self::_TABLE);
-
 
281
        $select->where->equalTo('company_id', $companyId);
-
 
282
        $select->order('job_description_id_boss, position, name');
-
 
283
        
-
 
284
        
-
 
285
        $prototype = new JobDescription();
-
 
286
        return $this->executeFetchAllObject($select, $prototype);
-
 
287
        
-
 
288
    }
-
 
289
    
-
 
290
    
-
 
291
    /**
-
 
292
     *
-
 
293
     * @param int $job_description_id_boss
-
 
294
     * @return JobDescription[]
-
 
295
     */
-
 
296
    public function fetchAllDefaultAndJobDescriptionIdBoss($job_description_id_boss) 
-
 
297
    {
-
 
298
        $select = $this->sql->select(self::_TABLE);
-
 
299
        if($job_description_id_boss) {
-
 
300
            $select->where->equalTo('job_description_id_boss', $job_description_id_boss);
-
 
301
        } else {
-
 
302
            $select->where->isNull('job_description_id_boss');
-
 
303
        }
-
 
304
        $select->order('position, name');
-
 
305
 
-
 
306
        $prototype = new JobDescription();
-
 
307
        return $this->executeFetchAllObject($select, $prototype);
-
 
308
    }
-
 
309
    
-
 
310
    
-
 
311
    /**
-
 
312
     *
-
 
313
     * @param int $companyId
-
 
314
     * @return JobDescription[]
-
 
315
     */
-
 
316
    public function fetchAllByCompanyIdAndJobDescriptionIdBoss($companyId, $job_description_id_boss) 
-
 
317
    {
-
 
318
        $select = $this->sql->select(self::_TABLE);
-
 
319
        $select->where->equalTo('company_id', $companyId);
-
 
320
        if($job_description_id_boss) {
-
 
321
            $select->where->equalTo('job_description_id_boss', $job_description_id_boss);
-
 
322
        } else {
-
 
323
            $select->where->isNull('job_description_id_boss');
-
 
324
        }
-
 
325
        $select->order('position, name');
-
 
326
        
-
 
327
        
-
 
328
        //echo $select->getSqlString($this->adapter->platform); exit;
-
 
329
        
-
 
330
 
-
 
331
        $prototype = new JobDescription();
-
 
332
        return $this->executeFetchAllObject($select, $prototype);
Línea 255... Línea 333...
255
        return $paginator;
333
        
256
    }
334
    }
257
 
335
 
258
    /**
336
    /**
Línea 309... Línea 387...
309
        $delete = $this->sql->delete(self::_TABLE);
387
        $delete = $this->sql->delete(self::_TABLE);
310
        $delete->where->equalTo('id', $jobDescription->id);
388
        $delete->where->equalTo('id', $jobDescription->id);
Línea 311... Línea 389...
311
 
389
 
312
        return $this->executeDelete($delete);
390
        return $this->executeDelete($delete);
-
 
391
    }
-
 
392
    
-
 
393
    
-
 
394
    /**
-
 
395
     *
-
 
396
     * @param int $job_description_id
-
 
397
     * @param int $position
-
 
398
     * @return boolean
-
 
399
     */
-
 
400
    public function removeJobDescriptionIdBossByJobDescriptionId($job_description_id, $position) 
-
 
401
    {
-
 
402
        $values = [
-
 
403
            'job_description_id_boss' => null,
-
 
404
            'position' => $position,
-
 
405
        ];
-
 
406
        
-
 
407
        $update = $this->sql->update(self::_TABLE);
-
 
408
        $update->set($values);
-
 
409
        $update->where->equalTo('id', $job_description_id);
-
 
410
        
-
 
411
        //error_log($update->getSqlString($this->adapter->platform));
-
 
412
        
-
 
413
        return $this->executeUpdate($update);
-
 
414
    }
-
 
415
    
-
 
416
    /**
-
 
417
     * 
-
 
418
     * @param int $job_description_id_boss
-
 
419
     * @return int
-
 
420
     */
-
 
421
    public function fetchMaxPositionByJobDescriptionIdBoss($job_description_id_boss)
-
 
422
    {
-
 
423
        $select = $this->sql->select(self::_TABLE);
-
 
424
        $select->columns(['max' => new Expression('MAX(position)')]);
-
 
425
        $select->where->equalTo('id', $job_description_id_boss);
-
 
426
        
-
 
427
        $record = $this->executeFetchOneArray($select);
-
 
428
        
-
 
429
        return intval($record['max'], 10);
-
 
430
    }
-
 
431
    
-
 
432
    
-
 
433
    /**
-
 
434
     *
-
 
435
     * @param int $job_description_id
-
 
436
     * @param int $job_description_id_boss
-
 
437
     * @param int $position
-
 
438
     * @return boolean
-
 
439
     */
-
 
440
    public function setJobDescriptionIdBossByJobDescripcionId($job_description_id, $job_description_id_boss, $position) 
-
 
441
    {
-
 
442
 
-
 
443
        $values = [
-
 
444
            'job_description_id_boss' => $job_description_id_boss,
-
 
445
            'position' => $position
-
 
446
        ];
-
 
447
        
-
 
448
        $update = $this->sql->update(self::_TABLE);
-
 
449
        $update->set($values);
-
 
450
        $update->where->equalTo('id', $job_description_id);
-
 
451
        
-
 
452
        //error_log($update->getSqlString($this->adapter->platform));
-
 
453
        
-
 
454
        return $this->executeUpdate($update);
Línea -... Línea 455...
-
 
455
    }
-
 
456
 
-
 
457
 
-
 
458
    /**
-
 
459
     *
-
 
460
     * @param JobDescription $jobDescription
-
 
461
     * @return boolean
-
 
462
     */
-
 
463
    public function removeAllJobDescriptionIdBossByJobDescripcionId($job_description_id)
-
 
464
    {
-
 
465
        $values = [
-
 
466
            'job_description_id_boss' => null,
-
 
467
        ];
-
 
468
        
-
 
469
        $update = $this->sql->update(self::_TABLE);
-
 
470
        $update->set($values);
-
 
471
        $update->where->equalTo('id', $job_description_id);
-
 
472
        
-
 
473
        //error_log($update->getSqlString($this->adapter->platform));
-
 
474
        
Línea 313... Línea 475...
313
    }
475
        return $this->executeUpdate($update);