aboutsummaryrefslogtreecommitdiff
path: root/src/bdrem/Source/Bdf.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2014-03-20 17:03:06 +0100
committerChristian Weiske <cweiske@cweiske.de>2014-03-20 17:03:06 +0100
commit6032c11d7a88651d85154ffe835a26b3f569c893 (patch)
treeb3cb83cb8d7dbcfa23891b84e3f0447c31e743c8 /src/bdrem/Source/Bdf.php
parent62842c0ba16bb1dc67435dea7b4d75af7773eacb (diff)
downloadbdrem-6032c11d7a88651d85154ffe835a26b3f569c893.tar.gz
bdrem-6032c11d7a88651d85154ffe835a26b3f569c893.zip
add docblocks to all files, classes, methods and variables
Diffstat (limited to 'src/bdrem/Source/Bdf.php')
-rw-r--r--src/bdrem/Source/Bdf.php41
1 files changed, 38 insertions, 3 deletions
diff --git a/src/bdrem/Source/Bdf.php b/src/bdrem/Source/Bdf.php
index f38e30f..651360a 100644
--- a/src/bdrem/Source/Bdf.php
+++ b/src/bdrem/Source/Bdf.php
@@ -1,13 +1,41 @@
<?php
+/**
+ * Part of bdrem
+ *
+ * PHP version 5
+ *
+ * @category Tools
+ * @package Bdrem
+ * @author Christian Weiske <cweiske@cweiske.de>
+ * @copyright 2014 Christian Weiske
+ * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
+ * @link http://cweiske.de/bdrem.htm
+ */
namespace bdrem;
/**
* Reads birthday reminder 2's birthday files (.bdf).
+ *
+ * @category Tools
+ * @package Bdrem
+ * @author Christian Weiske <cweiske@cweiske.de>
+ * @copyright 2014 Christian Weiske
+ * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
+ * @link http://cweiske.de/bdrem.htm
*/
class Source_Bdf
{
+ /**
+ * Full path of bdf birthday file
+ * @var string
+ */
protected $filename;
+ /**
+ * Set the birthday file name
+ *
+ * @param string $filename Path to bdf file
+ */
public function __construct($filename)
{
$this->filename = $filename;
@@ -19,9 +47,16 @@ class Source_Bdf
}
/**
- * @param string $strDate Date the events shall be found for, YYYY-MM-DD
+ * Return all events for the given date range
+ *
+ * @param string $strDate Date the events shall be found for,
+ * YYYY-MM-DD
+ * @param integer $nDaysPrevious Include number of days before $strDate
+ * @param integer $nDaysNext Include number of days after $strDate
+ *
+ * @return Event[] Array of matching event objects
*/
- public function getEvents($strDate, $nDaysPrev, $nDaysNext)
+ public function getEvents($strDate, $nDaysPrevious, $nDaysNext)
{
$x = simplexml_load_file($this->filename);
@@ -38,7 +73,7 @@ class Source_Bdf
(string) $xPerson->event,
$date
);
- if ($event->isWithin($strDate, $nDaysPrev, $nDaysNext)) {
+ if ($event->isWithin($strDate, $nDaysPrevious, $nDaysNext)) {
$arEvents[] = $event;
}
}