From e4fc3623cc4deb0948892812686662b04dd0a71f Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sun, 30 Oct 2011 21:21:39 +0000 Subject: [PATCH] PFAHandler.php: - add/update several comments git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1255 a1433add-5e2c-0410-b055-b7f2511e0802 --- model/PFAHandler.php | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/model/PFAHandler.php b/model/PFAHandler.php index f3bb7f7d..9ba78d7e 100644 --- a/model/PFAHandler.php +++ b/model/PFAHandler.php @@ -58,10 +58,13 @@ class PFAHandler { - + /** + * set and verify values + * @param array values - associative array with ($field1 => $value1, $field2 => $value2, ...) + * @return bool - true if all values are valid, otherwise false + * error messages (if any) are stored in $this->errormsg + */ public function set($values) { - # TODO: make this a generic function for add and edit - if ($this->new == 1) { $values[$this->id_field] = $this->id; } @@ -115,6 +118,8 @@ class PFAHandler { /** * store $this->values in the database * calls $this->storemore() where additional things can be done + * @return bool - true if all values are valid, otherwise false + * error messages (if any) are stored in $this->errormsg */ public function store() { if ($this->values_valid == false) { @@ -220,10 +225,11 @@ class PFAHandler { } /** - * get the settings of a domain + * get the values of an item * @param array or string $condition - * @return bool - true if at least one domain was found + * @return bool - true if at least one item was found * The data is stored in $this->return (as associative array of column => value) + * error messages (if any) are stored in $this->errormsg */ public function view($errors=true) { $result = $this->read_from_db(array($this->id_field => $this->id) ); @@ -238,9 +244,9 @@ class PFAHandler { } /** - * get a list of one or more domains with all settings + * get a list of one or more items with all values * @param array or string $condition - * @return bool - true if at least one domain was found + * @return bool - true if at least one item was found * The data is stored in $this->return (as array of rows, each row is an associative array of column => value) */ public function getList($condition) { @@ -256,7 +262,9 @@ class PFAHandler { } - + /************************************************************************** + * functions to read protected variables + */ public function getStruct() { return $this->struct; } @@ -273,7 +281,7 @@ class PFAHandler { } - /** + /************************************************************************** * functions for basic input validation */ function _inp_num($field, $val) {