Exemplo n.º 1
0
 public function __construct($fetch = true, $thisMonth = false)
 {
     $will_really_fetch = $fetch;
     parent::__construct('sickleave', $thisMonth ? false : $fetch);
     if ($will_really_fetch && $thisMonth) {
         $pdo = \DB::Instance()->pdo;
         if ($pdo instanceof \PDO) {
             if ($thisMonth) {
                 $stmt = $pdo->prepare("SELECT sickleave.* FROM sickleave JOIN user ON sickleave.for_id = user.id WHERE year(date) = year(localtime()) AND month(date) = month(localtime()) ORDER BY sickleave.date DESC");
             } else {
                 $stmt = $pdo->prepare("SELECT sickleave.* FROM sickleave JOIN user ON sickleave.for_id = user.id WHERE year(date) = year(localtime()) ORDER BY sickleave.date DESC");
             }
             $stmt->execute();
             $rows = $stmt->fetchAll();
             foreach ($rows as $row) {
                 $sickleave = new Sickleave();
                 $sickleave->Absorb($row);
                 $this->add($sickleave);
             }
         }
     }
 }
 public function __construct($fetch = true)
 {
     parent::__construct('Reports\\MonthlyIndividual', $fetch);
 }
 public function __construct($fetch = true)
 {
     parent::__construct('Reports\\MonthlyDepartment', $fetch);
 }
Exemplo n.º 4
0
 public function __construct($fetch = true)
 {
     parent::__construct('Reports\\MonthlyOverall', $fetch);
 }
Exemplo n.º 5
0
 /**
  * Create a new Metadata Collection
  *
  * @param array $data Collection Data
  */
 public function __construct(array $data)
 {
     $processedItems = $this->processItems($data);
     parent::__construct($processedItems);
 }
Exemplo n.º 6
0
 public function __construct($fetch = true)
 {
     parent::__construct('user', $fetch);
 }