XOOPS RMCommon Utilities
2.1.8.91RC
|
Public Member Functions | |
_loadFilters () | |
assignVar ($key, $value) | |
assignVars ($var_arr) | |
cleanVars () | |
errors ($html=true) | |
getErrors () | |
getHtmlErrors () | |
getLogger ($ashtml=true) | |
getValues ($keys=null, $format= 's', $maxDepth=1) | |
getVar ($key, $format= 's') | |
getVars ($formated=false, $format= 's') | |
id () | |
initVar ($key, $data_type, $value=null, $required=false, $maxlength=null, $options= '') | |
isDirty () | |
isNew () | |
registerFilter ($filtername) | |
rmClone () | |
setDirty () | |
setErrors ($err_str) | |
setFormVars ($var_arr=null, $pref='xo_', $not_gpc=false) | |
setNew () | |
setVar ($key, $value, $not_gpc=false) | |
setVarLen ($var, $len=null) | |
setVarRequired ($var, $required) | |
setVars ($var_arr, $not_gpc=false) | |
setVarType ($var, $type) | |
unsetDirty () | |
unsetNew () | |
Public Attributes | |
$cleanVars = array() | |
Protected Member Functions | |
addError ($text) | |
clear_vars () | |
clearLogger () | |
deleteFromTable () | |
getColumns () | |
initVarsFromTable () | |
loadValues ($id) | |
loadValuesArray ($values) | |
loadValuesFiltered ($filter='') | |
logger ($event, $style='') | |
saveToTable () | |
updateTable () | |
varIsset ($var) | |
Protected Attributes | |
$_dbtable = '' | |
$_log = array() | |
$db = null | |
$primary = 'id' | |
$vars = array() | |
Private Attributes | |
$_errors = array() | |
$_filters = array() | |
$_isDirty = false | |
$_isNew = false | |
$_tblcolumns = array() | |
$_uniquefield = '' | |
$objectColumns = array() | |
$primaryCols = array() | |
Basado en el archivo kernel/object.php de XOOPS creado por Kazumi Ono (AKA onokazu) Base class for all objects in the Xoops kernel (and beyond)
Definition at line 21 of file object.php.
RMObject::_loadFilters | ( | ) |
load all additional filters that have been registered to the object
private
Definition at line 549 of file object.php.
|
protected |
Agrega una entrada a nuestro array de errores.
string | $text | Descripcin del error |
Definition at line 611 of file object.php.
References setErrors().
Referenced by RMBlockPosition\delete(), RMComment\delete(), RMPlugin\delete(), RMInternalBlock\delete(), deleteFromTable(), RMPlugin\insert_configs(), RMInternalBlock\save(), saveToTable(), and updateTable().
RMObject::assignVar | ( | $key, | |
$value | |||
) |
assign a value to a variable
public
string | $key | name of the variable to assign |
mixed | $value | value to assign |
Definition at line 179 of file object.php.
Referenced by assignVars().
RMObject::assignVars | ( | $var_arr | ) |
assign values to multiple variables in a batch
private
array | $var_array | associative array of values to assign |
Definition at line 192 of file object.php.
References assignVar(), and unsetNew().
Referenced by loadValuesFiltered().
RMObject::cleanVars | ( | ) |
clean values of all variables of the object for storage. also add slashes whereever needed
Definition at line 439 of file object.php.
References getErrors(), TextCleaner\getInstance(), setErrors(), TextCleaner\stripslashes(), and unsetDirty().
Referenced by saveToTable(), and updateTable().
|
protected |
Clear all vars to start a new object
Definition at line 524 of file object.php.
|
protected |
Limpiamos el log de eventos
Definition at line 668 of file object.php.
|
protected |
Elimina un registro de la base de datos
Definition at line 936 of file object.php.
References $sql, and addError().
Referenced by RMBlockPosition\delete(), RMImageCategory\delete(), RMComment\delete(), RMImage\delete(), RMPlugin\delete(), and RMInternalBlock\delete().
RMObject::errors | ( | $html = true | ) |
Obtenemos los errores almacenados. Estos pueden obtenerse de dos maneras dependiendo del parmetro $html. false Nos devuelve un array y true nos devuelve una cadena HTML frmateada.
bol | $html | Devolver cadena HTML o array |
Definition at line 622 of file object.php.
References $_errors, and $ret.
Referenced by RMInternalBlock\delete(), getErrors(), and RMInternalBlock\save().
|
protected |
Funcin para obtener todas las columnas de una tabla de la base de datos la variable $_dbtable debe ser inicializada Devuelve un array con los nombres y datos de las columnas
Definition at line 704 of file object.php.
References $_tblcolumns, $objectColumns, $primaryCols, and $result.
Referenced by initVarsFromTable(), and updateTable().
RMObject::getErrors | ( | ) |
return the errors for this object as an array
Definition at line 592 of file object.php.
References errors().
Referenced by cleanVars().
RMObject::getHtmlErrors | ( | ) |
return the errors for this object as html
Definition at line 603 of file object.php.
RMObject::getLogger | ( | $ashtml = true | ) |
Recuperamos el log de elementos. Si es pasado como parmetro "false" devuelve un array. Si se pasa el valor "true" devuelve HTML
bol | $ashtml | True o False |
Definition at line 679 of file object.php.
RMObject::getValues | ( | $keys = null , |
|
$format = 's' , |
|||
$maxDepth = 1 |
|||
) |
Returns the values of the specified variables
mixed | $keys | An array containing the names of the keys to retrieve, or null to get all of them |
string | $format | Format to use (see getVar) |
int | $maxDepth | Maximum level of recursion to use if some vars are objects themselves |
Definition at line 283 of file object.php.
References $vars, and getVar().
RMObject::getVar | ( | $key, | |
$format = 's' |
|||
) |
returns a specific variable for the object in a proper format
public
string | $key | key of the object's variable to be returned |
string | $format | format to use for the output |
Definition at line 309 of file object.php.
References $i, $image, $options, $ret, and TextCleaner\getInstance().
Referenced by RMPlugin\__construct(), RMInternalBlock\buildBlock(), RMComment\delete(), RMImage\delete(), RMImage\get_sizes_data(), RMInternalBlock\getContent(), RMUser\getGroups(), RMInternalBlock\getOptions(), RMImage\getOriginal(), getValues(), getVars(), RMImageCategory\id(), RMComment\id(), RMCommentUser\id(), RMImage\id(), RMInternalBlock\id(), RMPlugin\id(), id(), RMInternalBlock\isCustom(), RMComment\load_user(), RMImageCategory\max_file_size(), RMPlugin\plugin(), RMUser\save(), RMImage\url(), and RMImageCategory\user_allowed_toupload().
RMObject::getVars | ( | $formated = false , |
|
$format = 's' |
|||
) |
returns all variables for the object
bool | Return formated vars? |
string | Format type (s,e,p,f) |
Definition at line 261 of file object.php.
References $ret, $vars, and getVar().
RMObject::id | ( | ) |
Definition at line 87 of file object.php.
References getVar().
Referenced by RMBlockPosition\delete().
RMObject::initVar | ( | $key, | |
$data_type, | |||
$value = null , |
|||
$required = false , |
|||
$maxlength = null , |
|||
$options = '' |
|||
) |
#@- initialize variables for the object
public
string | $key | |
int | $data_type | set to one of XOBJ_DTYPE_XXX constants (set to XOBJ_DTYPE_OTHER if no data type ckecking nor text sanitizing is required) |
mixed | ||
bool | $required | require html form input? |
int | $maxlength | for XOBJ_DTYPE_TXTBOX type only |
string | $option | does this data have any select options? |
Definition at line 140 of file object.php.
References $options.
Referenced by initVarsFromTable().
|
protected |
Funcin para inicializar las variables a partir de las columnas de una tabla
Definition at line 731 of file object.php.
References $type, getColumns(), and initVar().
Referenced by RMCommentUser\__construct(), RMBlockPosition\__construct(), RMUser\__construct(), RMImageCategory\__construct(), RMComment\__construct(), RMPlugin\__construct(), RMImage\__construct(), and RMInternalBlock\__construct().
RMObject::isDirty | ( | ) |
Definition at line 123 of file object.php.
References $_isDirty.
RMObject::isNew | ( | ) |
Definition at line 103 of file object.php.
References $_isNew.
Referenced by RMImage\get_all_versions(), RMImage\get_smallest(), RMImage\get_version(), RMImageCategory\save(), RMBlockPosition\save(), RMCommentUser\save(), RMComment\save(), RMUser\save(), RMImage\save(), RMPlugin\save(), RMInternalBlock\save(), and RMImage\url().
|
protected |
Cargaa los valores de un objeto desde la base de datos en base a su clave primaria
mixed | $id | Valor a buscar en la clave primaria |
Definition at line 808 of file object.php.
References $id, $result, $sql, and setVar().
Referenced by RMCommentUser\__construct(), RMBlockPosition\__construct(), RMUser\__construct(), RMImageCategory\__construct(), RMComment\__construct(), RMPlugin\__construct(), RMImage\__construct(), RMInternalBlock\__construct(), and RMImage\load_from_params().
|
protected |
Carga valores de la base de datos
array | $values | Array de valores |
limpiamos los valores
Definition at line 850 of file object.php.
References $result, $sql, TextCleaner\getInstance(), and setVar().
|
protected |
Load the object values from database with a filtered query
Definition at line 830 of file object.php.
References $result, $sql, and assignVars().
|
protected |
Funcin para agregar una entrada al log de eventos
string | $event | Texto del evento |
string | $style | Estilo css del evento |
Definition at line 659 of file object.php.
References $rtn.
RMObject::registerFilter | ( | $filtername | ) |
dynamically register additional filter for the object
string | $filtername | name of the filter public |
Definition at line 539 of file object.php.
RMObject::rmClone | ( | ) |
create a clone(copy) of the current object
public
Definition at line 563 of file object.php.
References $class.
|
protected |
Almacena los valores como un registro nuevo en una tabla
Definition at line 882 of file object.php.
References $sql, addError(), cleanVars(), TextCleaner\getInstance(), setVar(), and unsetNew().
Referenced by RMImageCategory\save(), RMBlockPosition\save(), RMCommentUser\save(), RMComment\save(), RMUser\save(), RMImage\save(), RMPlugin\save(), and RMInternalBlock\save().
RMObject::setDirty | ( | ) |
#@- #@+ mark modified objects as dirty
used for modified objects only public
Definition at line 115 of file object.php.
Referenced by setVar().
RMObject::setErrors | ( | $err_str | ) |
add an error
string | $value | error to add public |
Definition at line 581 of file object.php.
Referenced by addError(), and cleanVars().
RMObject::setFormVars | ( | $var_arr = null , |
|
$pref = 'xo_' , |
|||
$not_gpc = false |
|||
) |
Assign values to multiple variables in a batch
Meant for a CGI contenxt:
private
array | $var_arr | associative array of values to assign |
string | $pref | prefix (only keys starting with the prefix will be set) |
Definition at line 244 of file object.php.
References setVar().
RMObject::setNew | ( | ) |
#@+ used for new/clone objects
public
Definition at line 95 of file object.php.
Referenced by RMCommentUser\__construct(), RMBlockPosition\__construct(), RMUser\__construct(), RMImageCategory\__construct(), RMComment\__construct(), RMPlugin\__construct(), RMImage\__construct(), and RMInternalBlock\__construct().
RMObject::setVar | ( | $key, | |
$value, | |||
$not_gpc = false |
|||
) |
assign a value to a variable
public
string | $key | name of the variable to assign |
mixed | $value | value to assign |
bool | $not_gpc |
Definition at line 209 of file object.php.
References setDirty().
Referenced by RMPlugin\load_from_dir(), loadValues(), loadValuesArray(), save_comment(), saveToTable(), setFormVars(), and setVars().
RMObject::setVarLen | ( | $var, | |
$len = null |
|||
) |
Establece la longitud de un campo
string | $var | Nombre de la variable |
int | $len | Longitud del campo o null |
Definition at line 159 of file object.php.
RMObject::setVarRequired | ( | $var, | |
$required | |||
) |
Establece la obligatoriedad de una variable
string | $var | Nombre de la variable |
bool | $required |
Definition at line 168 of file object.php.
RMObject::setVars | ( | $var_arr, | |
$not_gpc = false |
|||
) |
assign values to multiple variables in a batch
private
array | $var_arr | associative array of values to assign |
bool | $not_gpc |
Definition at line 226 of file object.php.
References setVar().
RMObject::setVarType | ( | $var, | |
$type | |||
) |
Establece el tipo de dato para una variable
string | $var | Nombre de la variable |
int | $type | Tipo de Dato |
Definition at line 150 of file object.php.
References $type.
Referenced by RMImageCategory\__construct(), and RMInternalBlock\__construct().
RMObject::unsetDirty | ( | ) |
Definition at line 119 of file object.php.
Referenced by cleanVars().
RMObject::unsetNew | ( | ) |
Definition at line 99 of file object.php.
Referenced by RMCommentUser\__construct(), RMBlockPosition\__construct(), RMUser\__construct(), RMImageCategory\__construct(), RMComment\__construct(), RMPlugin\__construct(), RMImage\__construct(), RMInternalBlock\__construct(), assignVars(), RMImage\load_from_params(), and saveToTable().
|
protected |
Almacena las modificaciones hechas a un registro de una tabla
Definition at line 909 of file object.php.
References $sql, addError(), cleanVars(), getColumns(), and TextCleaner\getInstance().
Referenced by RMImageCategory\save(), RMBlockPosition\save(), RMCommentUser\save(), RMComment\save(), RMUser\save(), RMImage\save(), RMPlugin\save(), and RMInternalBlock\save().
|
protected |
Comrpobamos si ha sido inicializada una variable.
string | $var | Nombre de la variable |
Definition at line 647 of file object.php.
|
protected |
Definition at line 77 of file object.php.
|
private |
Definition at line 62 of file object.php.
Referenced by errors().
|
private |
additional filters registered dynamically by a child class object
private
Definition at line 69 of file object.php.
|
private |
Definition at line 54 of file object.php.
Referenced by isDirty().
|
private |
Definition at line 46 of file object.php.
Referenced by isNew().
|
protected |
Definition at line 76 of file object.php.
Referenced by getLogger().
|
private |
Definition at line 78 of file object.php.
Referenced by getColumns().
|
private |
Definition at line 79 of file object.php.
RMObject::$cleanVars = array() |
Definition at line 38 of file object.php.
|
protected |
Definition at line 75 of file object.php.
Referenced by RMPlugin\delete(), RMPlugin\insert_configs(), and RMComment\load_user().
|
private |
Almacena las columnas (variables) de un objeto
Definition at line 84 of file object.php.
Referenced by getColumns().
|
protected |
Almacena el nombre de la clave primaria en la base de datos (columna) esta por defecto es 'id'
Definition at line 74 of file object.php.
|
private |
Definition at line 85 of file object.php.
Referenced by getColumns().
|
protected |
Definition at line 30 of file object.php.
Referenced by getValues(), and getVars().