[ Index ]
 

Code source de b2evolution 2.1.0-beta

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/blogs/inc/_core/model/dataobjects/ -> _dataobject.class.php (sommaire)

This file implements the abstract DataObject base class. This file is part of the evoCore framework - {@link http://evocore.net/} See also {@link http://sourceforge.net/projects/evocms/}.

Author: fplanque: Francois PLANQUE
Author: blueyed: Daniel HAHLER
Author: mbruneau: Marc BRUNEAU / PROGIDISTRI
Copyright: (c)2003-2007 by Francois PLANQUE - {@link http://fplanque.net/}
Version: $Id: _dataobject.class.php,v 1.1 2007/06/25 10:58:56 fplanque Exp $
Poids: 680 lignes (21 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

DataObject:: (17 méthodes):
  DataObject()
  dbchange()
  dbupdate()
  dbinsert()
  dbsave()
  dbdelete()
  check_relations()
  check_delete()
  confirm_delete()
  get()
  dget()
  disp()
  set()
  set_param()
  set_from_Request()
  ID()
  history_info_icon()


Classe: DataObject  - X-Ref

Data Object Base Class

This is typically an abstract class, useful only when derived.

DataObject( $tablename, $prefix = '', $dbIDname = 'ID', $datecreated_field = '', $datemodified_field = '', $creator_field = '', $lasteditor_field = '' )   X-Ref
Constructor

param: string Name of table in database
param: string Prefix of fields in the table
param: string Name of the ID field (including prefix)
param: string datetime field name
param: string datetime field name
param: string User ID field name
param: string User ID field name

dbchange( $dbfieldname, $dbfieldtype, $valuepointer )   X-Ref
Records a change that will need to be updated in the db

param: string Name of parameter
param: string DB field type ('string', 'number', 'date' )
param: mixed Pointer to value of parameter - dh> pointer? So it should be a reference? Would make sense IMHO anyway.. fp> I just wonder why it's not already a reference... :@

dbupdate()   X-Ref
Update the DB based on previously recorded changes

return: boolean true on success, false on failure to update, NULL if no update necessary

dbinsert()   X-Ref
Insert object into DB based on previously recorded changes.

return: boolean true on success

dbsave()   X-Ref
Inserts or Updates depending on object state.

return: boolean true on success, false on failure

dbdelete()   X-Ref
Delete object from DB.

return: boolean true on success

check_relations( $what, $ignore = array()   X-Ref
Check relations for restrictions or cascades


check_delete( $restrict_title, $ignore = array()   X-Ref
Check relations for restrictions before deleting

param: string
param: array list of foreign keys to ignore
return: boolean true if no restriction prevents deletion

confirm_delete( $confirm_title, $delete_action, $hiddens, $cancel_action = NULL )   X-Ref
Displays form to confirm deletion of this object

param: string Title for confirmation
param: string "action" param value to use (hidden field)
param: array Hidden keys (apart from "action")
param: string most of the time we don't need a cancel action since we'll want to return to the default display

get( $parname )   X-Ref
Get a member param by its name

param: mixed Name of parameter
return: mixed Value of parameter

dget( $parname, $format = 'htmlbody' )   X-Ref
Get a ready-to-display member param by its name

Same as disp but don't echo

param: string Name of parameter
param: string Output format, see {@link format_to_output()}

disp( $parname, $format = 'htmlbody' )   X-Ref
Display a member param by its name

param: string Name of parameter
param: string Output format, see {@link format_to_output()}

set( $parname, $parvalue, $make_null = false )   X-Ref
Set param value

By default, all values will be considered strings

param: string parameter name
param: mixed parameter value
param: boolean true to set to NULL if empty value
return: boolean true, if a value has been set; false if it has not changed

set_param( $parname, $fieldtype, $parvalue, $make_null = false )   X-Ref
Set param value.

param: string Name of parameter
param: string DB field type ('string', 'number', 'date' )
param: mixed Value of parameter
param: boolean true to set to NULL if empty string value
return: boolean true, if value has been set/changed, false if not.

set_from_Request( $parname, $var = NULL, $make_null = false )   X-Ref
Set a parameter from a Request form value.

param: string Dataobject parameter name
param: string Request parameter name (NULL means to use Dataobject param name with its prefix)
param: boolean true to set to NULL if empty string value
return: boolean true, if value has been set/changed, false if not.

ID()   X-Ref
Template function: Displays object ID.


history_info_icon()   X-Ref
Create icon with dataobject history




Généré le : Thu Nov 29 23:58:50 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics