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