.

SystemUpdates Class Reference
[SystemUpdate]

Facade for System Update information. More...

List of all members.

Static Public Member Functions

static  create ($component, $connection, &$result)
  Create update information entry.
static  get ($component, $connection)
  Find system update information for given component.
static  update (DAOSystemupdates $entry, $connection)
  Update entry.

Detailed Description

Facade for System Update information.

Author:
Gerd Riesselmann

Definition at line 8 of file systemupdates.facade.php.


Member Function Documentation

static SystemUpdates::create ( component,
connection,
&$  result  
) [static]

Create update information entry.

Parameters:
string  $component
DAOSystemupdates  $result

Definition at line 38 of file systemupdates.facade.php.

00038                                                                          {
00039                 $params = array(
00040                         'component' => $component,
00041                         'version' => 0 
00042                 ); 
00043                 
00044                 // We must go low level, cause of connection
00045                 $dao = new DAOSystemupdates();
00046                 $dao->connection = $connection;
00047                 $dao->read_from_array($params);
00048                 
00049                 $query = $dao->create_insert_query();
00050                 
00051                 $ret = DB::execute($query->get_sql(), $connection);
00052                 if ($ret->is_ok()) {
00053                         $dao->id = DB::last_insert_id($connection);
00054                         $result = $dao;
00055                 }
00056 
00057                 return $ret;
00058         }
static SystemUpdates::get ( component,
connection  
) [static]

Find system update information for given component.

Parameters:
string  $component
Returns:
DAOSystemupdated

Definition at line 15 of file systemupdates.facade.php.

00015                                                             {
00016                 $dao = new DAOSystemupdates();
00017                 $dao->component = $component;
00018                 $dao->connection = $connection;
00019                 
00020                 $query = $dao->create_select_query();
00021                 
00022                 $result = DB::query($query->get_sql(), $connection);
00023                 if ($data = $result->fetch()) {
00024                         $dao = new DAOSystemupdates();
00025                         $dao->read_from_array($data);
00026                         return $dao;
00027                 }
00028                 
00029                 return false;
00030         }
static SystemUpdates::update ( DAOSystemupdates entry,
connection  
) [static]

Update entry.

Definition at line 63 of file systemupdates.facade.php.

00063                                                                             {
00064                 $entry->connection = $connection;
00065                 $query = $entry->create_update_query();
00066                 return DB::execute($query->get_sql(), $connection);
00067         }

The documentation for this class was generated from the following file: