From 192160797c7b18afca93842b43b2740abcffe615 Mon Sep 17 00:00:00 2001 From: James Date: Sat, 2 Apr 2011 08:15:16 +0100 Subject: [PATCH] Day of week data --- src/CreepyCoder.php | 4 +++- src/WriteDayOfWeekData.php | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 src/WriteDayOfWeekData.php diff --git a/src/CreepyCoder.php b/src/CreepyCoder.php index 95893db..f13b0d6 100644 --- a/src/CreepyCoder.php +++ b/src/CreepyCoder.php @@ -35,6 +35,8 @@ print(count($dataManager->getData())); require dirname(__FILE__).DIRECTORY_SEPARATOR.'WriteHourOfDayData.php'; - $dataManager->writeData(new WriteHourOfDayData(array())); +require dirname(__FILE__).DIRECTORY_SEPARATOR.'WriteDayOfWeekData.php'; +$dataManager->writeData(new WriteDayOfWeekData(array())); + diff --git a/src/WriteDayOfWeekData.php b/src/WriteDayOfWeekData.php new file mode 100644 index 0000000..fe3c0e8 --- /dev/null +++ b/src/WriteDayOfWeekData.php @@ -0,0 +1,35 @@ +. +**/ + + +class WriteDayOfWeekData extends BaseWriteClass { + + public function write() { + + $data = array(); + $data['Sun'] = $data['Mon'] = $data['Tue'] = $data['Wed'] = $data['Thu'] = $data['Fri'] = $data['Sat'] = 0; + + foreach($this->dataManager->getData() as $item) { + $data[$item->getDateTimeAs('D')]++; + } + + print_r($data); + } + +} +