noalyss Version-9
Public Member Functions
V_Contact_SQL Class Reference
+ Inheritance diagram for V_Contact_SQL:
+ Collaboration diagram for V_Contact_SQL:

Public Member Functions

 __construct ($p_cn, $p_id=-1)
 
 count ($p_where="", $p_array=null)
 
 delete ()
 
 exist ()
 Count the number of record with the id ,. 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

Definition at line 32 of file v_contact_sql.class.php.

Constructor & Destructor Documentation

◆ __construct()

V_Contact_SQL::__construct (   $p_cn,
  $p_id = -1 
)

Definition at line 34 of file v_contact_sql.class.php.

35 {
36 $this->table="public.v_contact";
37 $this->primary_key="f_id";
38 $a_name=explode(",","f_id,contact_fname,contact_name,contact_qcode,contact_company,contact_mobile,contact_phone,contact_email,contact_fax,card_category");
39 $this->type=[];
40 foreach ($a_name as $key) {
41 $this->type[trim($key)]="text";
42 $this->name[trim($key)]=$key;
43 }
44 $this->type['f_id']="number";
45 $this->type['card_category']="number";
46
47 parent::__construct($p_cn, $p_id);
48 }
$from_poste name
$input_from type
Definition: balance.inc.php:65
$all table

References $p_id, name, table, and type.

Member Function Documentation

◆ count()

V_Contact_SQL::count (   $p_where = "",
  $p_array = null 
)

Reimplemented from Data_SQL.

Definition at line 79 of file v_contact_sql.class.php.

80 {
81 throw new Exception("not implemented");
82 }

◆ delete()

V_Contact_SQL::delete ( )

Reimplemented from Data_SQL.

Definition at line 56 of file v_contact_sql.class.php.

57 {
58 throw new Exception("not implemented");
59 }

◆ exist()

V_Contact_SQL::exist ( )

Count the number of record with the id ,.

Returns
integer 0 doesn't exist , 1 exists

Reimplemented from Data_SQL.

Definition at line 84 of file v_contact_sql.class.php.

85 {
86 throw new Exception("not implemented");
87 }

◆ insert()

V_Contact_SQL::insert ( )

Reimplemented from Data_SQL.

Definition at line 51 of file v_contact_sql.class.php.

52 {
53 throw new Exception("not implemented");
54 }

◆ load()

V_Contact_SQL::load ( )

Load the current row return false if not found.

if ( $this->get_limit_fiche_qcode() != 0 )
{
$sql=sprintf($this->sql," limit ".$this->get_limit_fiche_qcode());
} else
{
$sql=sprintf($this->sql," ");
}
$result=$this->cn->get_array($sql. " where id=$1",array ($this->$pk));
if ($this->cn->count()==0)
{
$this->$pk=-1;
return false;
}
foreach ($result[0] as $key=> $value)
{
$this->$key=$value;
}
return true;
$input_from cn
Definition: balance.inc.php:66
$primary_key
Array of logical and real name.
Returns
bool

Reimplemented from Data_SQL.

Definition at line 66 of file v_contact_sql.class.php.

66 :bool
67 {
68 $array=$this->cn->get_row("select * from ".$this->table." where f_id=$1",array($this->f_id));
69 if (empty ($array) ) { $this->f_id=-1;return false;}
70 $this->to_row($array);
71 return true;
72 }
to_row($p_array)
turns a row fetched from the DB into a SQL object in updating all his attribute

References $array, cn, table, and Data_SQL\to_row().

+ Here is the call graph for this function:

◆ seek()

V_Contact_SQL::seek (   $cond = '',
  $p_array = null 
)

retrieve array of object thanks a condition

Parameters
$condcondition (where clause) (optional by default all the rows are fetched) you can use this parameter for the order or subselect
$p_arrayarray for the SQL stmt
See also
Database::exec_sql get_object Database::num_row
Returns
the return value of exec_sql

Reimplemented from Data_SQL.

Definition at line 74 of file v_contact_sql.class.php.

75 {
76 throw new Exception("not implemented");
77 }

◆ update()

V_Contact_SQL::update ( )

Reimplemented from Data_SQL.

Definition at line 61 of file v_contact_sql.class.php.

62 {
63 throw new Exception("not implemented");
64 }

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