@@ 128-136 (lines=9) @@ | ||
125 | * |
|
126 | * @return bool |
|
127 | */ |
|
128 | public function checkTableExist($table, $con=NULL) |
|
129 | { |
|
130 | $connection = $this->checkConnection($con); |
|
131 | $query = $connection->query("SELECT 1 FROM {$table} LIMIT 1"); |
|
132 | if($query !== false) |
|
133 | { |
|
134 | return true; |
|
135 | } |
|
136 | } |
|
137 | ||
138 | /** |
|
139 | * checkTableName Return the table name |
|
@@ 146-156 (lines=11) @@ | ||
143 | * |
|
144 | * @return string |
|
145 | */ |
|
146 | protected static function checkTableName($tableName, $con=NULL) |
|
147 | { |
|
148 | $connection = self::checkConnection($con); |
|
149 | ||
150 | $query = $connection->query("SELECT 1 FROM {$tableName} LIMIT 1"); |
|
151 | if($query !== false) |
|
152 | { |
|
153 | return $tableName; |
|
154 | } |
|
155 | throw new TableDoesNotExistException(); |
|
156 | } |
|
157 | ||
158 | /** |
|
159 | * checkColumn Check if column exist in table |