Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Class.DocCount.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Cache table to memorize count doc of different sql filter
8  *
9  * @author Anakeen
10  * @version $Id: Class.DocCount.php,v 1.1 2008/08/13 15:17:07 eric Exp $
11  * @package FDL
12  */
13 /**
14  */
15 
16 include_once ("Class.DbObj.php");
17 
18 class DocCount extends DbObj
19 {
20  public $fields = array(
21  "famid", // family identifier
22  "aid", // attribute identifier
23  "filter", // sql filter
24  "c", // count
25 
26  );
27  /**
28  * family identifier
29  * @public string
30  */
31  public $famid;
32  /**
33  * attribute identifier
34  * @public string
35  */
36  public $aid;
37  /**
38  * sql filter of the query
39  * @public string
40  */
41  public $filter;
42  /**
43  * count result
44  * @public int
45  */
46  public $c;
47 
48  public $id_fields = array(
49  "famid",
50  "aid",
51  "filter"
52  );
53 
54  public $dbtable = "doccount";
55 
56  public $sqlcreate = "
57 create table doccount ( famid int not null,
58  aid text not null,
59  filter text not null,
60  c int );
61 create index i_doccount on doccount(famid,aid);
62 ";
63 
64  function deleteAll()
65  {
66  $sql = sprintf("delete from %s where famid = %s and aid = '%s'", $this->dbtable, $this->famid, pg_escape_string($this->aid));
67 
68  return $this->exec_query($sql);
69  }
70 }
71 ?>
exec_query($sql, $lvl=0, $prepare=false)
← centre documentaire © anakeen