0

here is my problem : using cakePHP on a PHP 5.3 system, when we upgraded to php 5.4, the structure of a find resultat changed :

for example, having a modele "Foo" mapping a table "foo" after a find, the columns was under a "Foo" index, now it is under a "foo" (notice the uppecase difference)

the code was written by a person no longer here, and I'm totally new in cakePHP so it's hard to debug...

notice : we used cakephp 2.3, we migrated to 2.5 it didn't solved the problem

in the class properties, it's configured so :

public $useTable = 'Foo';
Bruno
  • 1,088
  • 1
  • 13
  • 31
  • I'm just guessing here as I can't test it right now, but maybe the lowercasing is done in order to avoid possible ambiguities, as `Foo` for both model and table would result in queries like ``SELECT `Foo`.`title` FROM `Foo` AS `Foo` ....``, not sure if any of the supported DBMS/drivers would have a problem with it. Have you tried lowercasing the name in `$useTable`, as your actual table name seems to be lowercase? – ndm Aug 21 '14 at 13:34
  • Yes, I tried, it didn't worked. I had to ad an alias uppercased. – Bruno Aug 21 '14 at 22:45

1 Answers1

0

the previous developer didn't repsected cakePHP naming convention, so the

public $useTable = 'Foo';

was to avoid the problem concerning the name of the table who wasn't plurial, I had to add

public $alias  = 'Foo';

in order to have the first letter uppercased, i don't know why it was uppercased under PHP 5.3 without this.

Bruno
  • 1,088
  • 1
  • 13
  • 31