Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5844857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:21:09+00:00 2026-05-22T12:21:09+00:00

I have the follwing fixiture file: Category: webDev: name: Development Web webDesign: name: Web

  • 0

I have the follwing fixiture file:

Category:
   webDev:
      name: Development Web
   webDesign:
      name: Web Desing
   Autres:
      name: Autres

Post:
   Post1:
      Category: webDev
      title: Ceci est un Test 1
      content: TEST
   Post2:
      Category: webDesign
      title: Ceci est un Test 2
      content: TEST
   Post3:
      Category: Autres
      title: Ceci est un Test 3
      content: TEST

The problem is that webDev is not recognized and the id is not automatically seted.

I don’t want to use like that:

 Post1:
      category_id: 1
      title: Ceci est un Test 1
      content: TEST

But I want to use the name of the webDev, webDesign or Autres categories names. Is working and I have no error when I run:

./symfony doctrine:build --all --no-confirmation --and-load 

However, when I look in MySQL database instead of the category id I get NULL. Why? Where is the error?

Here is my schema.yml

Category:
 tableName: categories
 columns:
  name: string(100)

Post:
 tableName: posts
 actAs:
  Timestampable: ~
  Sluggable:
   fields: [title]
 columns:
  category_id: integer
  title: string(100)
  content: text
 relations:
  Category:
   type: one
   foreignType: many
   local: id
   foreign: id
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:21:09+00:00Added an answer on May 22, 2026 at 12:21 pm

    According to your schema, the foreign key will bet set to post.id instead of post.category_id.

    try local: category_id instead of local: id

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I have the follwing domain classes. class Student { int age static hasMany
I have following table (type, id, title). When new object is created and type=1
Have following code: public interface ITest { string St1 { get; } } public
I have following scenario: Lets say we have two different webparts operating on the
I have following structure: class User < ActiveRecord::Base has_many :Hobbies, :dependent => :destroy accepts_nested_attributes_for
I have following model: class Customer < ActiveRecord::Base has_one :cart end class Cart <
I have following problem. I want to make some graphics in c# windows form.
I have following method in the c code. void add(int number) { Node node1;
There's a new dsl in capybara 1.0.0.rc1 that's very similar to steak. I'm trying
I am creating a pair1 class for a x and y Cartesian coordinate system.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.