Note that there are some explanatory texts on larger screens.

plurals
  1. POProblems with database relations with symfony framework - Cannot fetch TableMap for undefined table
    text
    copied!<p>Currently developing an application using the newest version of symfony, obtained through PEAR. This is my exact schema configuration</p> <pre><code>propel: user: id: name: { type: varchar(255), required: true } level: { type: integer, required: true, default: 1 } created_at: post: id: title: { type: varchar(255), required: true } post: { type: longvarchar, required: true } user_id: created_at: updated_at: comment: id: relation: integer comment: { type: varchar(300), required: true } nick: { type: varchar(100), required: true } created_at: updated_at: </code></pre> <p>The awake and aware of you have probably noticed that user_id in post is a foreign key to user. According to the definite guide; [quote title=Quote:](columns ending with _id are considered to be foreign keys, and the related table is automatically determined according to the first part of the column name).[/quote]</p> <p>Whenever I try to build EITHER filters or FORMS (build-filters/build-forms/build-all) I get the follwing error message.</p> <pre><code>&gt;&gt; propel generating form classes -----&gt; Cannot fetch TableMap for undefined table: user. Make sure you have the static MapBuilder registration code after your peer stub class definition. &lt;------ [?php /** * Post form base class. * * @package ##PROJECT_NAME## * @subpackage form * @author ##AUTHOR_NAME## * @version SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $ */ class BasePostForm extends BaseFormPropel { public function setup() { $this-&gt;setWidgets(array( 'id' =&gt; new sfWidgetFormInputHidden(), 'title' =&gt; new sfWidgetFormInput(), 'post' =&gt; new sfWidgetFormTextarea(), 'user_id' =&gt; new sfWidgetFormPropelChoice( </code></pre> <p>I've also tried defining the foreignTable and foreignReference in my schema, but without luck. This is a fresh symfony-project, only created to debug this error. I've tried using singular and plural names for my tables. Am I doing something horribly wrong, or is this a solid bug? Appreciate ANY input, this is driving me crazy!</p> <p>I have a forum thread over at symfony's official community, here: <a href="http://forum.symfony-project.org/index.php/m/77979/" rel="nofollow noreferrer">http://forum.symfony-project.org/index.php/m/77979/</a> - there's been some suggestions (like how I forgot to use a tilde and that "user" is a pre-defined class, but the problems remains <strong>SOLVED</strong> [edited] as of now.</p> <p><strong>One free internet hug, major props and a free space shuttle to the mighty soul who come up with a solution!</strong> (disclaimer: there's actually no free space shuttle)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload