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

  • SEARCH
  • Home
  • 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 8602653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:08:16+00:00 2026-06-12T02:08:16+00:00

I have a small database connected with my Symfony2 project. I have my controller,

  • 0

I have a small database connected with my Symfony2 project. I have my controller, the entity etc.

When I try to use the method find(), I am allways obtaining a null.

Here is how the find method is called:

 public function loginsuccessAction()
{

$em = $this->getDoctrine()->getEntityManager();
$user = $em->getRepository('MDPILoginBundle:Users')->find(1);

var_dump($user);
}

My Users entity class has the needed getters and setters. My table Users is well populated.

What am I missing ? New with symfony, I am trying to do it for the first time, reading some tutorials.

Thank you very much.

PS: If you need more details, please feel free to ask me.

EDIT: Entity Users.php added

Here is the Users.php entity

<?php

namespace MDPI\LoginBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * MDPI\LoginBundle\Entity\Users
 *
 * @ORM\Table(name="users")
 * @ORM\Entity
 */
class Users
{
/**
 * @var integer $id
 *
 * @ORM\Column(name="id", type="integer", nullable=false)
 * @ORM\Id
 * @ORM\GeneratedValue(strategy="IDENTITY")
 */
private $id;

/**
 * @var integer $editorId
 *
 * @ORM\Column(name="editor_id", type="integer", nullable=true)
 */
private $editorId;

/**
 * @var string $email
 *
 * @ORM\Column(name="email", type="string", length=255, nullable=false)
 */
private $email;

/**
 * @var string $password
 *
 * @ORM\Column(name="password", type="string", length=255, nullable=false)
 */
private $password;

/**
 * @var integer $titleId
 *
 * @ORM\Column(name="title_id", type="integer", nullable=true)
 */
private $titleId;

/**
 * @var string $firstname
 *
 * @ORM\Column(name="firstname", type="string", length=255, nullable=true)
 */
private $firstname;

/**
 * @var string $lastname
 *
 * @ORM\Column(name="lastname", type="string", length=255, nullable=true)
 */
private $lastname;

/**
 * @var string $department
 *
 * @ORM\Column(name="department", type="string", length=255, nullable=true)
 */
private $department;

/**
 * @var string $organization
 *
 * @ORM\Column(name="organization", type="string", length=255, nullable=true)
 */
private $organization;

/**
 * @var string $address1
 *
 * @ORM\Column(name="address1", type="string", length=255, nullable=true)
 */
private $address1;

/**
 * @var string $address2
 *
 * @ORM\Column(name="address2", type="string", length=255, nullable=true)
 */
private $address2;

/**
 * @var string $city
 *
 * @ORM\Column(name="city", type="string", length=50, nullable=true)
 */
private $city;

/**
 * @var string $state
 *
 * @ORM\Column(name="state", type="string", length=50, nullable=true)
 */
private $state;

/**
 * @var string $zipcode
 *
 * @ORM\Column(name="zipcode", type="string", length=50, nullable=true)
 */
private $zipcode;

/**
 * @var integer $countryId
 *
 * @ORM\Column(name="country_id", type="integer", nullable=true)
 */
private $countryId;

/**
 * @var string $telephone
 *
 * @ORM\Column(name="telephone", type="string", length=25, nullable=true)
 */
private $telephone;

/**
 * @var string $fax
 *
 * @ORM\Column(name="fax", type="string", length=25, nullable=true)
 */
private $fax;

/**
 * @var integer $workplaceId
 *
 * @ORM\Column(name="workplace_id", type="integer", nullable=true)
 */
private $workplaceId;

/**
 * @var integer $jobtypeId
 *
 * @ORM\Column(name="jobtype_id", type="integer", nullable=true)
 */
private $jobtypeId;

/**
 * @var string $researchKeywords
 *
 * @ORM\Column(name="research_keywords", type="string", length=255, nullable=true)
 */
private $researchKeywords;

/**
 * @var string $ip
 *
 * @ORM\Column(name="ip", type="string", length=15, nullable=true)
 */
private $ip;

/**
 * @var boolean $status
 *
 * @ORM\Column(name="status", type="boolean", nullable=false)
 */
private $status;

/**
 * @var boolean $active
 *
 * @ORM\Column(name="active", type="boolean", nullable=false)
 */
private $active;

/**
 * @var bigint $dateRegistered
 *
 * @ORM\Column(name="date_registered", type="bigint", nullable=false)
 */
private $dateRegistered;

/**
 * @var string $alertFrequency
 *
 * @ORM\Column(name="alert_frequency", type="string", length=10, nullable=true)
 */
private $alertFrequency;

/**
 * @var datetime $alertLastSuccess
 *
 * @ORM\Column(name="alert_last_success", type="datetime", nullable=false)
 */
private $alertLastSuccess;

/**
 * @var text $signature
 *
 * @ORM\Column(name="signature", type="text", nullable=true)
 */
private $signature;



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

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

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

/**
 * Set email
 *
 * @param string $email
 */
public function setEmail($email)
{
    $this->email = $email;
}

/**
 * Get email
 *
 * @return string 
 */
public function getEmail()
{
    return $this->email;
}

/**
 * Set password
 *
 * @param string $password
 */
public function setPassword($password)
{
    $this->password = $password;
}

/**
 * Get password
 *
 * @return string 
 */
public function getPassword()
{
    return $this->password;
}

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

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

/**
 * Set firstname
 *
 * @param string $firstname
 */
public function setFirstname($firstname)
{
    $this->firstname = $firstname;
}

/**
 * Get firstname
 *
 * @return string 
 */
public function getFirstname()
{
    return $this->firstname;
}

/**
 * Set lastname
 *
 * @param string $lastname
 */
public function setLastname($lastname)
{
    $this->lastname = $lastname;
}

/**
 * Get lastname
 *
 * @return string 
 */
public function getLastname()
{
    return $this->lastname;
}

/**
 * Set department
 *
 * @param string $department
 */
public function setDepartment($department)
{
    $this->department = $department;
}

/**
 * Get department
 *
 * @return string 
 */
public function getDepartment()
{
    return $this->department;
}

/**
 * Set organization
 *
 * @param string $organization
 */
public function setOrganization($organization)
{
    $this->organization = $organization;
}

/**
 * Get organization
 *
 * @return string 
 */
public function getOrganization()
{
    return $this->organization;
}

/**
 * Set address1
 *
 * @param string $address1
 */
public function setAddress1($address1)
{
    $this->address1 = $address1;
}

/**
 * Get address1
 *
 * @return string 
 */
public function getAddress1()
{
    return $this->address1;
}

/**
 * Set address2
 *
 * @param string $address2
 */
public function setAddress2($address2)
{
    $this->address2 = $address2;
}

/**
 * Get address2
 *
 * @return string 
 */
public function getAddress2()
{
    return $this->address2;
}

/**
 * Set city
 *
 * @param string $city
 */
public function setCity($city)
{
    $this->city = $city;
}

/**
 * Get city
 *
 * @return string 
 */
public function getCity()
{
    return $this->city;
}

/**
 * Set state
 *
 * @param string $state
 */
public function setState($state)
{
    $this->state = $state;
}

/**
 * Get state
 *
 * @return string 
 */
public function getState()
{
    return $this->state;
}

/**
 * Set zipcode
 *
 * @param string $zipcode
 */
public function setZipcode($zipcode)
{
    $this->zipcode = $zipcode;
}

/**
 * Get zipcode
 *
 * @return string 
 */
public function getZipcode()
{
    return $this->zipcode;
}

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

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

/**
 * Set telephone
 *
 * @param string $telephone
 */
public function setTelephone($telephone)
{
    $this->telephone = $telephone;
}

/**
 * Get telephone
 *
 * @return string 
 */
public function getTelephone()
{
    return $this->telephone;
}

/**
 * Set fax
 *
 * @param string $fax
 */
public function setFax($fax)
{
    $this->fax = $fax;
}

/**
 * Get fax
 *
 * @return string 
 */
public function getFax()
{
    return $this->fax;
}

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

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

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

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

/**
 * Set researchKeywords
 *
 * @param string $researchKeywords
 */
public function setResearchKeywords($researchKeywords)
{
    $this->researchKeywords = $researchKeywords;
}

/**
 * Get researchKeywords
 *
 * @return string 
 */
public function getResearchKeywords()
{
    return $this->researchKeywords;
}

/**
 * Set ip
 *
 * @param string $ip
 */
public function setIp($ip)
{
    $this->ip = $ip;
}

/**
 * Get ip
 *
 * @return string 
 */
public function getIp()
{
    return $this->ip;
}

/**
 * Set status
 *
 * @param boolean $status
 */
public function setStatus($status)
{
    $this->status = $status;
}

/**
 * Get status
 *
 * @return boolean 
 */
public function getStatus()
{
    return $this->status;
}

/**
 * Set active
 *
 * @param boolean $active
 */
public function setActive($active)
{
    $this->active = $active;
}

/**
 * Get active
 *
 * @return boolean 
 */
public function getActive()
{
    return $this->active;
}

/**
 * Set dateRegistered
 *
 * @param bigint $dateRegistered
 */
public function setDateRegistered($dateRegistered)
{
    $this->dateRegistered = $dateRegistered;
}

/**
 * Get dateRegistered
 *
 * @return bigint 
 */
public function getDateRegistered()
{
    return $this->dateRegistered;
}

/**
 * Set alertFrequency
 *
 * @param string $alertFrequency
 */
public function setAlertFrequency($alertFrequency)
{
    $this->alertFrequency = $alertFrequency;
}

/**
 * Get alertFrequency
 *
 * @return string 
 */
public function getAlertFrequency()
{
    return $this->alertFrequency;
}

/**
 * Set alertLastSuccess
 *
 * @param datetime $alertLastSuccess
 */
public function setAlertLastSuccess($alertLastSuccess)
{
    $this->alertLastSuccess = $alertLastSuccess;
}

/**
 * Get alertLastSuccess
 *
 * @return datetime 
 */
public function getAlertLastSuccess()
{
    return $this->alertLastSuccess;
}

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

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

}

  • 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-12T02:08:17+00:00Added an answer on June 12, 2026 at 2:08 am

    Make sure the value you are using in the find method is the same as the defined primary key ( @ID ) in your entity.

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

Sidebar

Related Questions

I have tried to build a small function that would be use in controller
I have a small database which is legacy from an almost defunct project. This
I have small database of business and their addresses. Using the Google Geocode API
I have a small database with tables containing a small amount of data which
I have a relatively small database that I would like to generate a diagram
I have a small image from a database and the image's average color need
In an access database I have a small function that is called on startup
I have a small Java file interacting with a postgresql database, so I've downloaded
We do have a small data warehouse in PostgreSQL database and I have to
I have a small php file which just creates the tables in a database.

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.