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); }
public function __construct($fetch = true) { parent::__construct('Reports\\MonthlyOverall', $fetch); }
/** * Create a new Metadata Collection * * @param array $data Collection Data */ public function __construct(array $data) { $processedItems = $this->processItems($data); parent::__construct($processedItems); }
public function __construct($fetch = true) { parent::__construct('user', $fetch); }