This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » legacy support » symfony 1.1 » propel: wrapped: Cannot fetch ColumnMap
propel: wrapped: Cannot fetch ColumnMap [message #96980] Thu, 08 April 2010 17:45
ljpumas  is currently offline ljpumas
Messages: 40
Registered: October 2007
Member
Hi volks,

I have a strange problem. My table looks like:
  media_category:
    _attributes:            { phpName: MediaCategory }
    mid:                    { type: integer, size:  11, required: true, primaryKey: true }
    cid:                    { type: integer, size:  11, required: true, primaryKey: true }
    _foreignKeys:
      mc_fk_mid:            { foreignTable: media, references: [ {local: mid, foreign: mid} ] }
      mc_fk_cid:            { foreignTable: category, references: [ {local: cid, foreign: cid} ] }



After build-model the doBuild() in MediaCategoryMapBuilder.php looks like this:
	public function doBuild()
	{
		$this->dbMap = Propel::getDatabaseMap('propel');

		$tMap = $this->dbMap->addTable('media_category');
		$tMap->setPhpName('MediaCategory');

		$tMap->setUseIdGenerator(false);

		$tMap->addForeignPrimaryKey('MID', 'Mid', 'int' , CreoleTypes::INTEGER, 'media', 'MID', true, 11);

		$tMap->addForeignPrimaryKey('CID', 'Cid', 'int' , CreoleTypes::INTEGER, 'category', 'CID', true, 11);

	} // doBuild()



But always when I use this line of code:
$c->add(MediaCategoryPeer::MID, 2);


I get this error:
[wrapped: Could not execute query [Native Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1] [User Info: SELECT ... FROM ... WHERE )]]
(The WHERE-clause is empty)

When I do this with custom query:
$c->add(MediaCategoryPeer::MID.'=2', Criteria::CUSTOM);


I get this Error:
Quote:


[wrapped: Cannot fetch ColumnMap for undefined column: MID=2]



Do you have any idea why this happens?

Thanks for help Smile
Previous Topic:Generte i18n language files
Next Topic:view.yml + multi-language || metas title + I18n
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software