从现有表User中检索用户

时间:2015-08-19 08:07:18

标签: php symfony fosuserbundle

我是Symfony的新手,我正在学习它是如何运作的。 所以我有一个数据库和一个名为USER的表,其中包含字段名称,用户名,密码等。 我正在尝试创建一个登录表单,该表单将从该表中获取用户。 我已经创建了我的enity用户 我已经阅读了文档here,但这不是我想要的,因为我说我的实体它还在那里。 我应该使用FOS用户bunble吗?我已经阅读了此捆绑包的文档here,但我没有得到最后一部分(第7步)。所以我的问题是,我可以将我的用户实体与FOS用户捆绑包一起使用吗?如果答案是否定的,还有另一个解决方案,sicne我不知道如何更改我的数据库表?

提前感谢大家

P.s我在此文档here之后生成了用户实体,这是结果类

namespace LocalWorker\BackendBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
 * Utente
 */
class Utente
{
    /**
     * @var string
     */
    private $uNome;

    /**
     * @var string
     */
    private $uCognome;

    /**
     * @var string
     */
    private $uUsername;

    /**
     * @var string
     */
    private $uPassword;

    /**
     * @var string
     */
    private $uEmail;

    /**
     * @var string
     */
    private $uRuolo;

    /**
     * @var integer
     */
    private $uStatus;

    /**
     * @var \DateTime
     */
    private $uDateIns;

    /**
     * @var \DateTime
     */
    private $uDateActive;

    /**
     * @var integer
     */
    private $uId;


    /**
     * Set uNome
     *
     * @param string $uNome
     * @return Utente
     */
    public function setUNome($uNome)
    {
        $this->uNome = $uNome;

        return $this;
    }

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

    /**
     * Set uCognome
     *
     * @param string $uCognome
     * @return Utente
     */
    public function setUCognome($uCognome)
    {
        $this->uCognome = $uCognome;

        return $this;
    }

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

    /**
     * Set uUsername
     *
     * @param string $uUsername
     * @return Utente
     */
    public function setUUsername($uUsername)
    {
        $this->uUsername = $uUsername;

        return $this;
    }

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

    /**
     * Set uPassword
     *
     * @param string $uPassword
     * @return Utente
     */
    public function setUPassword($uPassword)
    {
        $this->uPassword = $uPassword;

        return $this;
    }

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

    /**
     * Set uEmail
     *
     * @param string $uEmail
     * @return Utente
     */
    public function setUEmail($uEmail)
    {
        $this->uEmail = $uEmail;

        return $this;
    }

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

    /**
     * Set uRuolo
     *
     * @param string $uRuolo
     * @return Utente
     */
    public function setURuolo($uRuolo)
    {
        $this->uRuolo = $uRuolo;

        return $this;
    }

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

    /**
     * Set uStatus
     *
     * @param integer $uStatus
     * @return Utente
     */
    public function setUStatus($uStatus)
    {
        $this->uStatus = $uStatus;

        return $this;
    }

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

    /**
     * Set uDateIns
     *
     * @param \DateTime $uDateIns
     * @return Utente
     */
    public function setUDateIns($uDateIns)
    {
        $this->uDateIns = $uDateIns;

        return $this;
    }

    /**
     * Get uDateIns
     *
     * @return \DateTime 
     */
    public function getUDateIns()
    {
        return $this->uDateIns;
    }

    /**
     * Set uDateActive
     *
     * @param \DateTime $uDateActive
     * @return Utente
     */
    public function setUDateActive($uDateActive)
    {
        $this->uDateActive = $uDateActive;

        return $this;
    }

    /**
     * Get uDateActive
     *
     * @return \DateTime 
     */
    public function getUDateActive()
    {
        return $this->uDateActive;
    }

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

0 个答案:

没有答案