I have a table defined by:
Modification:
columns:
id:
type: integer
primary: true
autoincrement: true
name: string
author: string
attributes:
export: all
When I run this code:
开发者_运维技巧$tbl = new Doctrine_Table(
'Modifications',
Doctrine_Manager::getInstance()
->getCurrentConnection()
);
$tbl->findOneBy('name', 'yacoby');
I get this error:
Doctrine_Table_Exception: Invalid expression found: ()n()a()m()e() /home/yacoby/documents/dev/netbeans/php/Doctrine/Table.php:2741 /home/yacoby/documents/dev/netbeans/php/Doctrine/Table.php:1707 /home/yacoby/documents/dev/netbeans/ESSearch/test/library/Search/Table/ModsTest.php:21
Does anyone have any idea why and what I can do to fix it?
Try deleting the 's' after "Modification"...
If that doesn't have any affect, you may want to check that the table has been constructed properly by calling something like the method Doctrine_Table::getColumns
and checking the output (i.e. that the array contains the columns you defined).
If it isn't what you expect, check that the files that the models are defined in have been loaded properly.
If the table has been set up already somehow, the correct way to get it is like this:
$tbl = Doctrine::getTable($what);
I ran into the same error while trying to construct (while I should have been getting) the Doctrine_Table
of the $what
entity to run som magic find functions on it.
精彩评论