From 9059e4bab6e6c4eab851e30ec295536cbc4b6362 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 14 Jul 2014 09:22:11 -0400 Subject: [PATCH] Update phpdoc for Property Application Adding docs to the Controller index and Model files. --- Toolkit/Property/Controller.php | 42 +++++++++++++++++++++++----- Toolkit/Property/Display.php | 4 +-- Toolkit/Property/Models/Property.php | 8 +++--- Toolkit/Property/index.php | 14 ++++++++++ 4 files changed, 55 insertions(+), 13 deletions(-) diff --git a/Toolkit/Property/Controller.php b/Toolkit/Property/Controller.php index 3500269..f6e00b7 100644 --- a/Toolkit/Property/Controller.php +++ b/Toolkit/Property/Controller.php @@ -7,9 +7,9 @@ namespace Property; * PHP version 5.3 * * @category Toolkit - * @package Package + * @package Property * @author Steve Sutton - * @copyright 2013 Gaslight Media + * @copyright 2014 Gaslight Media * @license Gaslight Media * @version SVN: (0.1) * @link <> @@ -18,12 +18,12 @@ namespace Property; /** * Toolkit_Package_Controller * - * Description of Controller + * Controller Class for running the admin application for properties * * @category Toolkit - * @package Package + * @package Property * @author Steve Sutton - * @copyright 2013 Gaslight Media + * @copyright 2014 Gaslight Media * @license Gaslight Media * @release Release: (0.1) * @link <> @@ -36,6 +36,11 @@ class Controller const PROPERTY_IMAGE_STYLE = 'propertyImage'; const ADDRESS_EDITABLE = false; + /** + * Create the Controller Object + * + * @return void + */ public function __construct() { $this->smarty = new \Toolkit_Smarty( @@ -47,6 +52,11 @@ class Controller $this->dbh = \Toolkit_Database::getInstance(); } + /** + * Filters the POST array. + * + * @return array Filtered array of posted key value pairs + */ public function getFilteredPostData() { return filter_var_array( @@ -68,7 +78,15 @@ class Controller ); } - public function processImages() + /** + * Processes data for the property. + * + * If the $_FILES array contains an empty value then the hidden field + * is used. + * + * @return void + */ + private function _processProperty() { $file1Uploaded = false; if (!$_FILES['image']['error']) { @@ -95,10 +113,15 @@ class Controller $property->save($this->dbh); } + /** + * Outputs the html for the administration area. + * + * @return void + */ public function toHtml() { if ($_POST || $_FILES) { - $this->processImages(); + $this->_processProperty(); header('Location: ' . $_SERVER['PHP_SELF']); exit; } @@ -121,6 +144,11 @@ class Controller echo $this->smarty->fetch('index.tpl'); } + /** + * Returns an array of properties + * + * @return array Properties in an array + */ public function getProperties() { $mapper = new \Property\Models\Property(); diff --git a/Toolkit/Property/Display.php b/Toolkit/Property/Display.php index 71f909f..bc676ac 100644 --- a/Toolkit/Property/Display.php +++ b/Toolkit/Property/Display.php @@ -6,9 +6,9 @@ * PHP version 5.3 * * @category Toolkit - * @package Package + * @package Property * @author Steve Sutton - * @copyright 2013 Gaslight Media + * @copyright 2014 Gaslight Media * @license Gaslight Media * @version SVN: (0.1) * @link <> diff --git a/Toolkit/Property/Models/Property.php b/Toolkit/Property/Models/Property.php index ea0d39d..feb1517 100644 --- a/Toolkit/Property/Models/Property.php +++ b/Toolkit/Property/Models/Property.php @@ -7,9 +7,9 @@ namespace Property\Models; * PHP version 5.3 * * @category Toolkit - * @package Package + * @package Property * @author Steve Sutton - * @copyright 2013 Gaslight Media + * @copyright 2014 Gaslight Media * @license Gaslight Media * @version SVN: (0.1) * @link <> @@ -21,9 +21,9 @@ namespace Property\Models; * Description of Image * * @category Toolkit - * @package Package + * @package Property * @author Steve Sutton - * @copyright 2013 Gaslight Media + * @copyright 2014 Gaslight Media * @license Gaslight Media * @release Release: (0.1) * @link <> diff --git a/Toolkit/Property/index.php b/Toolkit/Property/index.php index 58fb67a..de5f543 100644 --- a/Toolkit/Property/index.php +++ b/Toolkit/Property/index.php @@ -1,4 +1,18 @@ + * @copyright 2014 Gaslight Media + * @license Gaslight Media + * @version SVN: (0.1) + * @link <> + */ require_once '../../setup.phtml'; require_once BASE . 'Toolkit/Property/Controller.php'; require_once BASE . 'Toolkit/Property/Models/Property.php'; -- 2.17.1