Example #1
0
 /**
  * Returns table object by table name.
  * @intellisense
  */
 function &Table($strTable)
 {
     $this->FillTablesList();
     foreach ($this->lstTables as $tbl) {
         if (strtoupper($strTable) == strtoupper($tbl["name"])) {
             $this->CreateClass($tbl);
             return $this->{$tbl["varname"]};
         }
     }
     //	check table names without dbo. and other prefixes
     foreach ($this->lstTables as $tbl) {
         if (strtoupper(cutprefix($strTable)) == strtoupper(cutprefix($tbl["name"]))) {
             $this->CreateClass($tbl);
             return $this->{$tbl["varname"]};
         }
     }
     $dummy = null;
     return $dummy;
 }
Example #2
0
 /**
  * Returns table object by table name.
  * @intellisense
  */
 function &Table($strTable, $schema = "", $connName = "")
 {
     $this->FillTablesList();
     foreach ($this->lstTables as $tbl) {
         if (strtoupper($strTable) == strtoupper($tbl["name"]) && (schema == "" || strtoupper($schema) == strtoupper($tbl["schema"])) && ($connName == "" || strtoupper($connName) == strtoupper($tbl["connName"]))) {
             $this->CreateClass($tbl);
             return $this->{"tbl" . $tbl["varname"]};
         }
     }
     //	check table names without dbo. and other prefixes
     foreach ($this->lstTables as $tbl) {
         if (strtoupper(cutprefix($strTable)) == strtoupper(cutprefix($tbl["name"]))) {
             $this->CreateClass($tbl);
             return $this->{"tbl" . $tbl["varname"]};
         }
     }
     $dummy = null;
     return $dummy;
 }