Ok cool - so it's a reserved word. You can sometimes get around the reserved words (if you really want to and I wouldn't suggest it) by putting the word in [].
-----Original Message----- From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com] On Behalf Of joshuacoady Sent: 13 May 2009 12:07 To: symfony users Subject: [symfony-users] Re: Fatal error: Call to a member function end() on a non-object in ... Hydrator/RecordDriver.php You can safely delete the Dictionary relation to repeat the error .... though I finally figured this out ... there's some sort of naming collision because it doesnt like the foreignAlias of Data .. if I change that to Data2 it works as expected. On May 13, 2:06 am, "David Ashwood" <da...@inspiredthinking.co.uk> wrote: > Hi Josh, > > The coffee is still sinking in - your schema appears to be incomplete - you > reference Dictionary but it doesn't appear to exist (at least in the snippet > you've provided). > > -----Original Message----- > From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com] > > On Behalf Of joshuacoady > Sent: 13 May 2009 03:25 > To: symfony users > Subject: [symfony-users] Fatal error: Call to a member function end() on a > non-object in ... Hydrator/RecordDriver.php > > I'm getting the following error and cant figure out why. > > Fatal error: Call to a member function end() on a non-object in .../ > Doctrine/Hydrator/RecordDriver.php on line 51 > > The relevant code in that file is: > > public function getLastKey($coll) > { > $coll->end(); > > return $coll->key(); > } > > It is expecting $coll to be of type Doctrine_Collection, but it is > getting passed an array. > > The line that calls that is 218 of Hydrator.php: > > $identifierMap[$path][$id[$parent]][$id[$dqlAlias]] = $driver- > >getLastKey($prev[$parent][$relationAlias]); > > Query to repeat: > > Doctrine_Query::create() > ->from('Entry e') > ->innerJoin('e.Data da') > ->innerJoin('e.MetaData md') > ->execute(); > > I included the MetaData relationship because the relationship between > Entry and EntryData is almost the same as Entry to EntryMeta, but the > EntryData causes the error, i.e. if you remove the e.Data da join, the > error goes away. > > My schema is as follows: > > Entry: > columns: > id: > type: integer > primary: true > autoincrement: true > notnull: true > dictionary_id: > type: integer > notnull: true > slug: > type: string(255) > notnull: true > headword: > type: string(255) > notnull: true > has_pronunciation: > type: boolean > default: false > notnull: true > html: > type: clob > notnull: true > options: > type: INNODB > collate: utf8_unicode_ci > charset: utf8 > indexes: > slug: > fields: [slug] > relations: > Dictionary: > local: dictionary_id > foreign: id > foreignAlias: Entries > > EntryData: > columns: > id: > type: integer > primary: true > autoincrement: true > notnull: true > entry_id: > type: integer > notnull: true > name: > type: string(50) > notnull: true > type: > type: enum > values: [text, xml, html] > notnull: true > text: > type: clob > notnull: true > indexes: > uk_name_type: > fields: [entry_id, name, type] > type: unique > relations: > Entry: > local: entry_id > foreign: id > foreignAlias: Data > > EntryMeta: > columns: > id: > type: integer > primary: true > autoincrement: true > notnull: true > entry_id: > type: integer > notnull: true > type: > type: integer > notnull: true > value: > type: string(2000) > notnull: true > indexes: > uk_type: > fields: [entry_id, type] > type: unique > relations: > Entry: > local: entry_id > foreign: id > foreignAlias: MetaData > > A similar issue has been reported athttp://groups.google.com/group/symfony-users/browse_thread/thread/456... > fa0d5a/532fc6ee8427cc04?#532fc6ee8427cc04 > > Any ideas? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---