noalyss Version-9
v_contact_sql.class.php
Go to the documentation of this file.
1<?php
2/*
3 * Copyright (C) 2017 Dany De Bontridder <dany@alchimerys.be>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19
20/**
21* class_user_filter_sql.php
22*
23* @file
24* @brief abstract of the view public.v_contact
25*/
26
27/**
28* @class User_filter_SQL
29* @brief ORM abstract of the view public.v_contact_sql
30*/
31
33{
34 function __construct($p_cn, $p_id = -1)
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 }
49
50
51 function insert()
52 {
53 throw new Exception("not implemented");
54 }
55
56 function delete()
57 {
58 throw new Exception("not implemented");
59 }
60
61 function update()
62 {
63 throw new Exception("not implemented");
64 }
65
66 function load():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 }
73
74 function seek($cond = '', $p_array = null)
75 {
76 throw new Exception("not implemented");
77 }
78
79 function count($p_where = "", $p_array = null)
80 {
81 throw new Exception("not implemented");
82 }
83
84 function exist()
85 {
86 throw new Exception("not implemented");
87 }
88}
$input_from cn
Definition: balance.inc.php:66
$from_poste name
$input_from type
Definition: balance.inc.php:65
this an abstract class , all the SQL class, like noalyss_sql (table), Acc_Plan_SQL (based on a SQL no...
to_row($p_array)
turns a row fetched from the DB into a SQL object in updating all his attribute
count($p_where="", $p_array=null)
seek($cond='', $p_array=null)
retrieve array of object thanks a condition
load()
Load the current row return false if not found.
__construct($p_cn, $p_id=-1)
exist()
Count the number of record with the id ,.
$all table