Source for file Record.class.php
Documentation is available at Record.class.php
* Gumbo Library Framework
* This library is being released under the terms of the New BSD License. A
* copy of the license is packaged with the software (LICENSE.txt). If no
* copy is found, a copy of the license template can be found at:
* http://www.opensource.org/licenses/bsd-license.php
* @copyright Copyright (c) 2007, iBayou, Michael Luster
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @author Michael Luster <mluster79@yahoo.com>
* @link http://sourceforge.net/projects/phpgumbo
* This Interface is responsible for representing a database table record. It
* provides methods to retrieve record information as well as manipulating the
* data. The record can be saved, removed, or a new one created.
* @copyright Copyright (c) 2007, iBayou, Michael Luster
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @author Michael Luster <mluster79@yahoo.com>
* @link http://sourceforge.net/projects/phpgumbo
* Sets the value of a table column
public function __set ($column, $val);
* Unsets the value of the supplied table column
* Returns the raw value of the column name
public function __get ($column);
* Returns if the Column is set
* Loads the record into memory
* Loads an XML string, but only the first level of the parent
* @param string $parent name of top level XML element
public function loadXML ($xml, $parent=
null);
* Clears the object values, leaves the columns structure
* @param bool $erase_all clears extra values from memory
public function unload ($erase_all=
false);
* Removes the record from the database
* @precondition isLoaded ()
* @precondition !isReadOnly ()
* Saves a modified record to the database
* @precondition isLoaded ()
* @precondition isModified ()
* @precondition !isReadOnly ()
* Creates a new record in the database
* @precondition !isLoaded ()
* @precondition isModified ()
* @precondition !isReadOnly
* Resets the object by removing the values from the modified array
public function reset ();
* Sets the object as read only
* Adds (increments) to the current count columns value
* @precondition _isColumnCount ($column)
* @param string $column count column name
* @param int $num increases by the supplied number
public function add ($column, $num=
1);
* Wrapper to add() method
* @param string $column count column name
* @param int $num increases by the supplied number
* Subtracts (decrement) one from the count column value
* @precondition _isColumnCount ($column)
* @param string $column count column name
* @param int $num decreases by the supplied number
* @param bool $allow_negative allows negative values
public function sub ($column, $num=
1, $allow_negative=
false);
* Wrapper to sub() method
* @param string $column count column name
* @param int $num decreases by the supplied number
* @param bool $allow_negative allows negative values
public function decrement ($column, $num=
1, $allow_negative=
false);
* Returns the primary key name
* Returns the primary key value
* Returns the value of a column
* @param string $column Column Name
public function get ($column);
* Returns the XML parent element name
* Returns the entire Columns array
// Modified table columns
* Returns all modified table columns array
* Returns all the extra columns array
* Returns all the count columns
* Returns if the records was loaded
* Returns if the record was modified
* Returns if the record accesses the database
* Returns the object as an XML formatted string
* @param string $parent parent element name
public function asXML ($parent=
null);