Spaces and remove useless function

This commit is contained in:
slawkens 2024-06-01 15:53:34 +02:00
parent a1d7c94166
commit 9f2a51b351

View File

@ -15,15 +15,15 @@
/** /**
* Basic data access object routines. * Basic data access object routines.
* *
* <p> * <p>
* This class defines basic mechanisms for all classes that will represent database accessors. However no coding logic is defined here - only connection handling and PHP core-related stuff to enable variouse operations with objects. * This class defines basic mechanisms for all classes that will represent database accessors. However no coding logic is defined here - only connection handling and PHP core-related stuff to enable variouse operations with objects.
* </p> * </p>
* *
* <p> * <p>
* This class is mostly usefull when you create own extensions for POT code. * This class is mostly usefull when you create own extensions for POT code.
* </p> * </p>
* *
* @package POT * @package POT
* @version 0.1.0 * @version 0.1.0
*/ */
@ -31,14 +31,14 @@ abstract class OTS_Base_DAO implements IOTS_DAO
{ {
/** /**
* Database connection. * Database connection.
* *
* @var PDO * @var PDO
*/ */
protected $db; protected $db;
/** /**
* Sets database connection handler. * Sets database connection handler.
* *
* @version 0.1.0 * @version 0.1.0
*/ */
public function __construct() public function __construct()
@ -48,11 +48,11 @@ abstract class OTS_Base_DAO implements IOTS_DAO
/** /**
* Magic PHP5 method. * Magic PHP5 method.
* *
* <p> * <p>
* Allows object serialisation. * Allows object serialisation.
* </p> * </p>
* *
* @return array List of properties that should be saved. * @return array List of properties that should be saved.
*/ */
public function __sleep() public function __sleep()
@ -62,7 +62,7 @@ abstract class OTS_Base_DAO implements IOTS_DAO
/** /**
* Magic PHP5 method. * Magic PHP5 method.
* *
* <p> * <p>
* Allows object unserialisation. * Allows object unserialisation.
* </p> * </p>
@ -74,7 +74,7 @@ abstract class OTS_Base_DAO implements IOTS_DAO
/** /**
* Creates clone of object. * Creates clone of object.
* *
* <p> * <p>
* Copy of object needs to have different ID. * Copy of object needs to have different ID.
* </p> * </p>
@ -83,38 +83,4 @@ abstract class OTS_Base_DAO implements IOTS_DAO
{ {
unset($this->data['id']); unset($this->data['id']);
} }
/**
* Magic PHP5 method.
*
* <p>
* Allows object importing from {@link http://www.php.net/manual/en/function.var-export.php var_export()}.
* </p>
*
* @version 0.1.0
* @param array $properties List of object properties.
*/
public static function __set_state($properties)
{
// deletes database handle
if( isset($properties['db']) )
{
unset($properties['db']);
}
// initializes new object with current database connection
$object = new self();
// loads properties
foreach($properties as $name => $value)
{
$object->$name = $value;
}
return $object;
}
} }
/**#@-*/
?>