@@ -18,7 +18,6 @@ |
||
18 | 18 | along with this program; if not, write to the Free Software |
19 | 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 | */ |
21 | -use Doctrine\DBAL\Driver\Connection; |
|
22 | 21 | |
23 | 22 | |
24 | 23 | /** |
@@ -22,16 +22,12 @@ |
||
22 | 22 | use Doctrine\Common\Cache\Cache; |
23 | 23 | use Doctrine\Common\Cache\VoidCache; |
24 | 24 | use Doctrine\DBAL\Connection; |
25 | -use Doctrine\DBAL\DBALException; |
|
26 | -use Doctrine\DBAL\Schema\Column; |
|
27 | 25 | use Doctrine\DBAL\Schema\ForeignKeyConstraint; |
28 | -use Doctrine\DBAL\Schema\Schema; |
|
29 | 26 | use Mouf\Database\MagicQuery; |
30 | 27 | use Mouf\Database\SchemaAnalyzer\SchemaAnalyzer; |
31 | 28 | use Mouf\Database\TDBM\Filters\OrderBySQLString; |
32 | 29 | use Mouf\Database\TDBM\Utils\TDBMDaoGenerator; |
33 | 30 | use Mouf\Utils\Cache\CacheInterface; |
34 | -use SQLParser\Node\ColRef; |
|
35 | 31 | |
36 | 32 | /** |
37 | 33 | * The TDBMService class is the main TDBM class. It provides methods to retrieve TDBMObject instances |
@@ -441,10 +441,11 @@ discard block |
||
441 | 441 | /*$data =*/ $this->connection->getTableInfo($table_name); |
442 | 442 | } catch (TDBMException $exception) { |
443 | 443 | $probable_table_name = $this->connection->checkTableExist($table_name); |
444 | - if ($probable_table_name == null) |
|
445 | - throw new TDBMException("Error while calling TDBMObject::getNewObject(): The table named '$table_name' does not exist."); |
|
446 | - else |
|
447 | - throw new TDBMException("Error while calling TDBMObject::getNewObject(): The table named '$table_name' does not exist. Maybe you meant the table '$probable_table_name'."); |
|
444 | + if ($probable_table_name == null) { |
|
445 | + throw new TDBMException("Error while calling TDBMObject::getNewObject(): The table named '$table_name' does not exist."); |
|
446 | + } else { |
|
447 | + throw new TDBMException("Error while calling TDBMObject::getNewObject(): The table named '$table_name' does not exist. Maybe you meant the table '$probable_table_name'."); |
|
448 | + } |
|
448 | 449 | } |
449 | 450 | |
450 | 451 | if ($className === null) { |
@@ -886,8 +887,9 @@ discard block |
||
886 | 887 | // Fourth, let's apply the same steps to the orderby_bag |
887 | 888 | // 4-1 orderby_bag should be an array, if it is a singleton, let's put it in an array. |
888 | 889 | |
889 | - if (!is_array($orderby_bag)) |
|
890 | - $orderby_bag = array($orderby_bag); |
|
890 | + if (!is_array($orderby_bag)) { |
|
891 | + $orderby_bag = array($orderby_bag); |
|
892 | + } |
|
891 | 893 | |
892 | 894 | // 4-2, let's take all the objects out of the orderby bag, and let's make objects from them |
893 | 895 | $orderby_bag2 = array(); |
@@ -2,8 +2,6 @@ |
||
2 | 2 | namespace Mouf\Database\TDBM\Utils; |
3 | 3 | |
4 | 4 | use Doctrine\DBAL\Driver\Connection; |
5 | -use Doctrine\DBAL\Schema\Column; |
|
6 | -use Doctrine\DBAL\Schema\ForeignKeyConstraint; |
|
7 | 5 | use Doctrine\DBAL\Schema\Schema; |
8 | 6 | use Doctrine\DBAL\Schema\Table; |
9 | 7 | use Doctrine\DBAL\Types\Type; |
@@ -230,7 +230,7 @@ |
||
230 | 230 | $defaultSort = $data['column_name']; |
231 | 231 | if (count($matches == 3)){ |
232 | 232 | $defaultSortDirection = $matches[2]; |
233 | - }else{ |
|
233 | + } else{ |
|
234 | 234 | $defaultSortDirection = 'ASC'; |
235 | 235 | } |
236 | 236 | } |
@@ -18,7 +18,6 @@ |
||
18 | 18 | along with this program; if not, write to the Free Software |
19 | 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 | */ |
21 | -use Doctrine\DBAL\Driver\Connection; |
|
22 | 21 | |
23 | 22 | |
24 | 23 | /** |
@@ -18,7 +18,6 @@ |
||
18 | 18 | along with this program; if not, write to the Free Software |
19 | 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 | */ |
21 | -use Doctrine\DBAL\Driver\Connection; |
|
22 | 21 | |
23 | 22 | |
24 | 23 | /** |
@@ -18,7 +18,6 @@ |
||
18 | 18 | along with this program; if not, write to the Free Software |
19 | 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 | */ |
21 | -use Doctrine\DBAL\Driver\Connection; |
|
22 | 21 | |
23 | 22 | |
24 | 23 | /** |
@@ -27,12 +27,10 @@ |
||
27 | 27 | public function __construct($iterator, callable $callable) { |
28 | 28 | if (is_array($iterator)) { |
29 | 29 | $this->iterator = new \ArrayIterator($iterator); |
30 | - } |
|
31 | - elseif (!($iterator instanceof Iterator)) |
|
30 | + } elseif (!($iterator instanceof Iterator)) |
|
32 | 31 | { |
33 | 32 | throw new TDBMException("\$iterator parameter must be an instance of Iterator"); |
34 | - } |
|
35 | - else |
|
33 | + } else |
|
36 | 34 | { |
37 | 35 | $this->iterator = $iterator; |
38 | 36 | } |