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 8665441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:28:54+00:00 2026-06-12T17:28:54+00:00

I have an Symfony2 project cnnected to the database. For each table I have

  • 0

I have an Symfony2 project cnnected to the database. For each table I have an entity.

Now, I am trying to connect one Entity with another using ManyToOne.

Here is the problem:

I have Two entitys: User and Workplace.

In the User Entity, I have:

 /**
 * @ORM\ManyToOne(targetEntity="Workplace")
 * @ORM\JoinColumn(name="workplace", referencedColumnName="place")
 **/
protected $workplace;

/**
 * Set workplace
 *
 * @param integer $workplace
 */
public function setWorkplace($workplace)
{
    $this->workplace = $workplace;
}

/**
 * Get workplace
 *
 * @return integer 
 */
public function getWorkplace()
{
    return $this->workplace;
}

In the Workplace Entity I have:

/**
 * @ORM\Column(type="text")
 */
protected $place;



/**
 * Set place
 *
 * @param text $place
 */
public function setPlace($place)
{
    $this->place = $place;
}

/**
 * Get place
 *
 * @return text 
 */
public function getPlace()
{
    return $this->place;
}

And with that, I am getting an exception:

Neither property "workplace" nor method "getWorkplace()" nor method "isWorkplace()" exists in class "SciForum\Version2Bundle\Entity\Workplace" 

How could this be resolved. Thank you very much.

  • 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-06-12T17:28:55+00:00Added an answer on June 12, 2026 at 5:28 pm

    Try this

    ->add('place','entity',  array('class'=>'yourBundle:WorkPlace',
                                   'property'=>'place'))
    

    in your form Type.

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

Sidebar

Related Questions

I have a Symfony2 project with its own database, and now I want to
I have a question about symfony2. I have a project and I am using
I have a slow query in a Symfony2 project using Doctrine2. I am unsure
I have developed a project in symfony2.0.16. Now I would like to upgrade to
I have a join-table which is created by using @ORM\ManyToMany annotation in Symfony2/Doctrine. It
I have a small database connected with my Symfony2 project. I have my controller,
I am using many to many relations in my symfony2 project, i have successfully
I have an entity type form field in my Symfony2 project. $builder = $this->createFormBuilder();
I have a Like entity with a getDislike() function in my Symfony2-Doctrine2 project. Once
I have a custom form type for a Rating entity in my Symfony2 project.

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.