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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:33:42+00:00 2026-06-17T15:33:42+00:00

simple question but i don’t know how to do it. As an example we

  • 0

simple question but i don’t know how to do it.
As an example we have User Entity for login (class below), how can i change $password to $accountPass ? Ofcourse it means that all relationships must be applied as it is $password, and all symfony2 classes must understand that variable (old) $password now is (changed to) $accountPass.

Question is about “names of variables”… Anyone know how to deal with it?

User Entity :

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;

/**
 * @ORM\Entity()
 * @ORM\Table(name="_account")
 * @UniqueEntity("username")
 */
class User implements UserInterface
{

public function __construct()
{
    $this->salt = md5(uniqid(null, true));
    $this->isActive = true;
}

/**
 * Get roles
 *
 * @return string 
 */
public function getRoles()
{
    return array('ROLE_USER');
}

/**
 * 
 *
 * @return 
 */
public function eraseCredentials()
{

}

/**
 * Get equals
 *
 * @return boolean
 */
public function equals(UserInterface $user)
{
    return $user->getUsername() == $this->getUsername();
}

/**
 * @var integer
 *
 * @ORM\Id
 * @ORM\Column(name="id", type="integer")
 * @ORM\GeneratedValue(strategy="AUTO")
 */
protected $id;

/**
 * @var string
 * 
 * @ORM\Column(name="username", type="string", length=255, unique=true)
 */
protected $username;

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

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

/**
 * @var string
 * 
 * @ORM\Column(name="salt", type="string", length=255)
 */
protected $salt;

/**
 * @var boolean
 * @ORM\Column(name="isActive", type="boolean")
 */
protected $isActive;

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

/**
 * Set username
 *
 * @param string $username
 * @return User
 */
public function setUsername($username)
{
    $this->username = $username;

    return $this;
}

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

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

    return $this;
}

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

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

    return $this;
}

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

/**
 * Set salt
 *
 * @param string $salt
 * @return User
 */
public function setSalt($salt)
{
    $this->salt = $salt;

    return $this;
}

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

/**
 * Set isActive
 *
 * @param string $isActive
 * @return User
 */
public function setIsActive($isActive)
{
    $this->isActive = $isActive;

    return $this;
}

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

}

  • 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-17T15:33:43+00:00Added an answer on June 17, 2026 at 3:33 pm

    Check this answer: https://stackoverflow.com/a/12147185/927636

    You have to map all fields in your Entity class and name them as you want to.

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

Sidebar

Related Questions

It's very simple question but I don't know the answer. class a { public:
It is a simple question but I don't know how to do it because
This is a simple question but I don't know how to construct a variable
Ok so this maybe a simple/silly question but I don't know so here goes:
I think this is a relatively simple question, but I don't precisely know what's
( I know this is probably a simple question to answer, but I don't
seems like a simple question but I don't know JavaScript too well and my
Sorry if this will be too common or simple question but I don't know
I have a simple question, but don't seem to see the answer in a
How do i change a db name in mongodb? Simple question but i can't

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.