PluginProbe
ShiftController Employee Shift Scheduling / 4.9.66
ShiftController Employee Shift Scheduling v4.9.66
4.9.97 4.9.96 4.9.95 4.9.74 4.9.75 4.9.76 4.9.77 4.9.78 4.9.84 4.9.85 4.9.87 4.9.91 4.9.92 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.2.4 All 38 releases
shiftcontroller / sh4 / reminders / querylog.php

querylog.php in ShiftController Employee Shift Scheduling 4.9.66, at sh4/reminders/querylog.php

66 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
2 interface SH4_Reminders_QueryLog_
3 {
4 public function findAll();
5 }
6
7 class SH4_Reminders_QueryLog implements SH4_Reminders_QueryLog_
8 {
9 protected $_storage = array();
10 public $self, $crud;
11
12 public function __construct(
13 HC3_Hooks $hooks,
14 HC3_CrudFactory $crudFactory
15 )
16 {
17 $crudFactory = $hooks->wrap( $crudFactory );
18
19 $this->crud = $hooks->wrap( $crudFactory->make('reminderlog') );
20 $this->self = $hooks->wrap( $this );
21 }
22
23 public function findAll()
24 {
25 $args = array();
26 $ret = $this->self->read( $args );
27 return $ret;
28 }
29
30 public function read( array $args = array() )
31 {
32 $args[] = array( 'sort', 'date', 'asc' );
33
34 $ret = $this->crud->read( $args );
35 $ids = array_keys( $ret );
36
37 foreach( $ids as $id ){
38 $ret[$id] = $this->_arrayToModel( $ret[$id] );
39 // $this->_storage[$id] = $return[$id];
40 }
41 // uasort( $return, array($this, '_sort') );
42
43 return $ret;
44 }
45
46 protected function _arrayToModel( array $array )
47 {
48 static $sortOrder = 1;
49
50 $id = array_key_exists('id', $array) ? $array['id'] : NULL;
51 $range = array_key_exists('range', $array) ? $array['range'] : NULL;
52 $date = array_key_exists('date', $array) ? $array['date'] : NULL;
53 $employee_id = array_key_exists('employee_id', $array) ? $array['employee_id'] : NULL;
54 $sent_on = array_key_exists('sent_on', $array) ? $array['sent_on'] : NULL;
55
56 $ret = new SH4_Reminders_ModelLog;
57
58 $ret->id = $id;
59 $ret->range = $range;
60 $ret->date = $date;
61 $ret->employee_id = $employee_id;
62 $ret->sent_on = $sent_on;
63
64 return $ret;
65 }
66 }