Changeset 8993 for extensions


Ignore:
Timestamp:
Jan 30, 2011, 10:32:47 PM (14 years ago)
Author:
grum
Message:

release 3.4.0
review table classe

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/GrumPluginClasses/classes/GPCTables.class.inc.php

    r8992 r8993  
    4545  public function __construct($tables)
    4646  {
    47     $this->tables = $tables;
     47    $this->setTables($tables);
    4848  }
    4949
     
    5555
    5656
    57   /*
    58       create tables
    59       $tables_def is an array of SQL CREATE queries
    60 
    61       return true if everything is ok, otherwise tablename
    62   */
    63   public function create($tables_def)
     57  public function setTables($tables)
     58  {
     59    $this->tables = $tables;
     60  }
     61
     62  /**
     63   *   create tables
     64   *
     65   * @param Array $tablesDef : array of SQL CREATE queries
     66   * @return Bool : true if everything is ok, otherwise tablename
     67   */
     68  public function create($tablesDef)
    6469  {
    6570    //deleting tables if exists
    6671
    67     $this->drop($tables_def);
    68 
    69     for($i=0;$i<count($tables_def);$i++)
    70     {
    71       $result=pwg_query($tables_def[$i]);
     72    $this->drop();
     73
     74    for($i=0;$i<count($tablesDef);$i++)
     75    {
     76      $result=pwg_query($tablesDef[$i]);
    7277      if(!$result)
    7378      {
Note: See TracChangeset for help on using the changeset viewer.