noalyss Version-9
Public Member Functions
Menu_Ref Class Reference

Menu_Ref let you manage the available menu. More...

+ Inheritance diagram for Menu_Ref:
+ Collaboration diagram for Menu_Ref:

Public Member Functions

 format_code ()
 
 verify ()
 
- Public Member Functions inherited from Menu_Ref_SQL
 __construct (DatabaseCore &$p_cn, $p_id=-1)
 
- Public Member Functions inherited from Table_Data_SQL
 __construct ($p_cn, $p_id=-1)
 
 build_query ()
 Build the SQL select statement for querying the object and returns it. More...
 
 column_update ($column_expr, $value)
 update the value of a column with an expression for $value for the current record More...
 
 count ($p_where="", $p_array=null)
 return the number of count in the table corresponding to the where condition More...
 
 delete ()
 
 exist ()
 Count the number of record with the id ,. More...
 
 get_all_to_array ($p_key_col, $p_cond="", $p_array=NULL)
 Get all the row and use the p_key_code are the key value of array. More...
 
 insert ()
 
 load ()
 Load the current row return false if not found. More...
 
 seek ($cond='', $p_array=null)
 retrieve array of object thanks a condition More...
 
 update ()
 
- Public Member Functions inherited from Data_SQL
 __construct (DatabaseCore $p_cn, $p_id=-1)
 
 __toString ()
 
 collect_objects ($cond='', $p_array=null)
 return an array of objects. More...
 
 count ($p_where="", $p_array=null)
 
 delete ()
 
 exist ()
 Count the number of record with the id ,. More...
 
 from_array ($p_array)
 Transform an array into object. More...
 
 get ($p_string)
 get the value thanks the colum name and not the alias (name). More...
 
 get_cn ()
 
 get_info ()
 
 get_name ()
 
 get_object ($p_ret, $idx)
 
 get_pk_value ()
 
 get_primary_key ()
 
 get_type ()
 
 getp ($p_string)
 set the value thanks the alias name instead of the colum name More...
 
 insert ()
 
 load ()
 Load the current row return false if not found. More...
 
 next ($ret, $i)
 get_seek return the next object, the return of the query must have all the column of the object More...
 
 save ()
 Insert or update : if the row already exists, update otherwise insert. More...
 
 seek ($cond='', $p_array=null)
 retrieve array of object thanks a condition More...
 
 set ($p_string, $p_value)
 set the value thanks the colum name and not the alias (name) More...
 
 set_cn ($cn)
 
 set_name ($name)
 
 set_pk_value ($p_value)
 
 set_primary_key ($primary_key)
 
 set_type ($type)
 
 setp ($p_string, $p_value)
 set the value thanks the alias name instead of the colum name More...
 
 to_array ($prefix="")
 Turn an object (row) into an array, and the key could be prefixed with $prefix. More...
 
 to_row ($p_array)
 turns a row fetched from the DB into a SQL object in updating all his attribute More...
 
 update ()
 
 verify ()
 

Additional Inherited Members

- Data Fields inherited from Data_SQL
 $cn
 
 $date_format
 Type of the data. More...
 
 $default
 defaullt date format More...
 
 $name
 Database connection. More...
 
 $primary_key
 Array of logical and real name. More...
 
 $table
 
 $type
 Column name of the primary key. More...
 

Detailed Description

Menu_Ref let you manage the available menu.

Definition at line 29 of file menu_ref.class.php.

Member Function Documentation

◆ format_code()

Menu_Ref::format_code ( )

Definition at line 31 of file menu_ref.class.php.

32 {
33 $this->me_code=strtoupper($this->me_code);
34 $this->me_code=trim($this->me_code);
35 $this->me_code=noalyss_str_replace('<','',$this->me_code);
36 $this->me_code=noalyss_str_replace('>','',$this->me_code);
37
38 }
noalyss_str_replace($search, $replace, $string)
Definition: ac_common.php:1553

References noalyss_str_replace().

Referenced by verify().

+ Here is the call graph for this function:

◆ verify()

Menu_Ref::verify ( )
Todo:
ajout vérification type (date, text ou numeric)
Returns
int

Reimplemented from Data_SQL.

Definition at line 39 of file menu_ref.class.php.

40 {
41 try
42 {
43 parent::verify();
44 if ( $this->me_code == -1)
45 {
46 throw new Exception(_("le code ne peut être vide"));
47 }
48 $this->format_code();
49 if ( $this->cn->get_value("select count(*) from menu_ref where me_code=$1",array($this->me_code)) > 0)
50 throw new Exception ('Doublon');
51 if (trim($this->me_code)=='')
52 throw new Exception ('Ce menu existe déjà');
53 if (empty($this->me_code) ) {
54 throw new Exception(_("le code ne peut être vide"));
55 }
56
57 if ( ! file_exists('../include/'.$this->me_file)) throw new Exception ('Ce menu fichier '.$this->me_file." n'existe pas");
58
59 return 0;
60 } catch (Exception $e)
61 {
62 alert($e->getMessage());
63 return -1;
64 }
65 }
alert($p_msg, $buffer=false)
alert in javascript
Definition: ac_common.php:738
$input_from cn
Definition: balance.inc.php:66

References $e, alert(), cn, and format_code().

+ Here is the call graph for this function:

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