noalyss
Version-6.7.2
|
Manage the table public.menu_ref. More...
Public Member Functions | |
__construct (&$p_cn, $p_id=-1) | |
delete () | |
get_info () | |
get_object ($p_ret, $idx) | |
get_seek return the next object, the return of the query must have all the column of the object | |
get_parameter ($p_string) | |
insert () | |
load () | |
load a object | |
seek ($cond='', $p_array=null) | |
retrieve array of object thanks a condition | |
set_parameter ($p_string, $p_value) | |
update () | |
verify () | |
Static Public Member Functions | |
static | test_me () |
Unit test for the class. | |
Protected Attributes | |
$variable |
Manage the table public.menu_ref.
Definition at line 33 of file class_menu_ref_sql.php.
Menu_Ref_sql::__construct | ( | &$ | p_cn, |
$ | p_id = -1 |
||
) |
Definition at line 48 of file class_menu_ref_sql.php.
Definition at line 90 of file class_menu_ref_sql.php.
{ return var_export($this, true); }
Menu_Ref_sql::get_object | ( | $ | p_ret, |
$ | idx | ||
) |
get_seek return the next object, the return of the query must have all the column of the object
$p_ret | is the return value of an exec_sql |
$idx | is the index |
Definition at line 139 of file class_menu_ref_sql.php.
References $array, $idx, $value, cn, and Database\fetch_array().
{ // map each row in a object $oobj = new Menu_Ref_sql($this->cn); $array = Database::fetch_array($p_ret, $idx); foreach ($array as $idx => $value) { $oobj->$idx = $value; } return $oobj; }
Menu_Ref_sql::get_parameter | ( | $ | p_string | ) |
Definition at line 68 of file class_menu_ref_sql.php.
References $idx.
Definition at line 151 of file class_menu_ref_sql.php.
References $sql, cn, and verify().
Referenced by Extension\insert_plugin().
{ if ($this->verify() != 0) return; $sql = "insert into public.menu_ref(me_menu ,me_file ,me_url ,me_description ,me_parameter ,me_javascript ,me_type ,me_code) values ($1 ,$2 ,$3 ,$4 ,$5 ,$6 ,$7 ,$8 ) returning me_code"; $this->me_code = $this->cn->get_value( $sql, array($this->me_menu , $this->me_file , $this->me_url , $this->me_description , $this->me_parameter , $this->me_javascript , $this->me_type , $this->me_code) ); }
load a object
Definition at line 215 of file class_menu_ref_sql.php.
References $idx, $res, $sql, $value, and cn.
Referenced by __construct(), and Extension\search().
{ $sql = "select me_menu ,me_file ,me_url ,me_description ,me_parameter ,me_javascript ,me_type from public.menu_ref where me_code=$1"; /* please adapt */ $res = $this->cn->get_array( $sql, array($this->me_code) ); if (count($res) == 0) { /* Initialize an empty object */ foreach ($this->variable as $key => $value) $this->$key = ''; return -1; } foreach ($res[0] as $idx => $value) { $this->$idx = $value; } return 0; }
Menu_Ref_sql::seek | ( | $ | cond = '' , |
$ | p_array = null |
||
) |
retrieve array of object thanks a condition
$cond | condition (where clause) (optional by default all the rows are fetched) you can use this parameter for the order or subselect |
$p_array | array for the SQL stmt |
Definition at line 123 of file class_menu_ref_sql.php.
Menu_Ref_sql::set_parameter | ( | $ | p_string, |
$ | p_value | ||
) |
Definition at line 79 of file class_menu_ref_sql.php.
References $idx.
static Menu_Ref_sql::test_me | ( | ) | [static] |
Definition at line 186 of file class_menu_ref_sql.php.
References $res, $sql, cn, and verify().
Referenced by Extension\update_plugin().
{ if ($this->verify() != 0) return; /* please adapt */ $sql = " update public.menu_ref set me_menu = $1 ,me_file = $2 ,me_url = $3 ,me_description = $4 ,me_parameter = $5 ,me_javascript = $6 ,me_type = $7 where me_code= $8"; $res = $this->cn->exec_sql( $sql, array($this->me_menu , $this->me_file , $this->me_url , $this->me_description , $this->me_parameter , $this->me_javascript , $this->me_type , $this->me_code) ); }
Reimplemented in Extension, and Menu_Ref.
Definition at line 95 of file class_menu_ref_sql.php.
References trim().
Referenced by insert(), and update().
{ // Verify that the elt we want to add is correct /* verify only the datatype */ if (trim($this->me_menu) == '') $this->me_menu = null; if (trim($this->me_file) == '') $this->me_file = null; if (trim($this->me_url) == '') $this->me_url = null; if (trim($this->me_description) == '') $this->me_description = null; if (trim($this->me_parameter) == '') $this->me_parameter = null; if (trim($this->me_javascript) == '') $this->me_javascript = null; if (trim($this->me_type) == '') $this->me_type = null; }
Menu_Ref_sql::$variable [protected] |
array( "me_code" => "me_code" , "me_menu" => "me_menu" , "me_file" => "me_file" , "me_url" => "me_url" , "me_description" => "me_description" , "me_parameter" => "me_parameter" , "me_javascript" => "me_javascript" , "me_type" => "me_type" )
Definition at line 37 of file class_menu_ref_sql.php.