Update phpdoc for Property Application
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 14 Jul 2014 13:22:11 +0000 (09:22 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 14 Jul 2014 13:22:11 +0000 (09:22 -0400)
Adding docs to the Controller index and Model files.

Toolkit/Property/Controller.php
Toolkit/Property/Display.php
Toolkit/Property/Models/Property.php
Toolkit/Property/index.php

index 3500269..f6e00b7 100644 (file)
@@ -7,9 +7,9 @@ namespace Property;
  * PHP version 5.3
  *
  * @category  Toolkit
- * @package   Package
+ * @package   Property
  * @author    Steve Sutton <steve@gaslightmedia.com>
- * @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 <steve@gaslightmedia.com>
- * @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();
index 71f909f..bc676ac 100644 (file)
@@ -6,9 +6,9 @@
  * PHP version 5.3
  *
  * @category  Toolkit
- * @package   Package
+ * @package   Property
  * @author    Steve Sutton <steve@gaslightmedia.com>
- * @copyright 2013 Gaslight Media
+ * @copyright 2014 Gaslight Media
  * @license   Gaslight Media
  * @version   SVN: (0.1)
  * @link      <>
index ea0d39d..feb1517 100644 (file)
@@ -7,9 +7,9 @@ namespace Property\Models;
  * PHP version 5.3
  *
  * @category  Toolkit
- * @package   Package
+ * @package   Property
  * @author    Steve Sutton <steve@gaslightmedia.com>
- * @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 <steve@gaslightmedia.com>
- * @copyright 2013 Gaslight Media
+ * @copyright 2014 Gaslight Media
  * @license   Gaslight Media
  * @release   Release: (0.1)
  * @link      <>
index 58fb67a..de5f543 100644 (file)
@@ -1,4 +1,18 @@
 <?php
+
+/**
+ * index.php
+ *
+ * PHP version 5.3
+ *
+ * @category  Toolkit
+ * @package   Property
+ * @author    Steve Sutton <steve@gaslightmedia.com>
+ * @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';