问题已解决
我没有为实体用户中的每个字段设置@ORM\列。更新的用户实体:
<?php
namespace FYProject\ProjectBundle\Entity;
use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
/**
*
* @ORM\Entity
* @ORM\Table(name="fyp_user")
*/
class User extends BaseUser
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=100)
*
*/
protected $name;
/**
* @var string
*
* @ORM\Column(name="lastname", type="string", length=100)
*/
protected $lastname;
/**
* @var string
*
* @ORM\Column(name="school", type="string", length=100)
*/
protected $school;
/**
* @var string
*
* @ORM\Column(name="qualification", type="string", length=50)
*/
protected $qualification;
/**
* @var string
*
* @ORM\Column(name="modeofstudy", type="string", length=50)
*/
protected $modeofstudy;
/**
* @var string
*
* @ORM\Column(name="programmecode", type="string", length=50)
*/
protected $programmecode;
/**
* @var integer
*
* @ORM\Column(name="programmeyear", type="integer", length=10)
*/
protected $programmeyear;
/**
* @var datetime
*
* @ORM\Column(name="startdate", type="datetime", length=50)
*/
protected $startdate;
/**
* @var string
*
* @ORM\Column(name="building", type="string", length=50)
*/
protected $building;
/**
* @var integer
*
* @ORM\Column(name="room", type="integer", length=50)
*/
protected $room;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set name
*
* @param string $name
* @return Entity
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set school
*
* @param string $school
* @return Entity
*/
public function setSchool($school)
{
$this->school = $school;
return $this;
}
/**
* Get school
*
* @return string
*/
public function getSchool()
{
return $this->school;
}
/**
* set qualification
*
* @param string $qualification
* @return Entity
*/
public function setQualification($qualification){
$this->qualification = $qualification;
return $this;
}
/**
* get qualification
*
* @return string
*/
public function getQualification(){
return $this->qualification;
}
/**
* set modeofstudy
*
* @param string $modeofstudy
* @return Entity
*/
public function setModeofstudy($modeofstudy){
$this->modeofstudy = $modeofstudy;
return $this;
}
/**
* get modeofstudy
*
* @return string
*/
public function getModeofstudy(){
return $this->modeofstudy;
}
/**
* set programmecode
*
* @param string $programmecode
* @return Entity
*/
public function setProgrammecode($programmecode){
$this->programmecode = $programmecode;
return $this;
}
/**
* get programmecode
*
* @return string
*/
public function getProgrammecode(){
return $this->programmecode;
}
/**
* set programmeyear
*
* @param integer $programmeyear
* @return Entity
*/
public function setProgrammeyear($programmeyear){
$this->programmecode = $programmeyear;
return $this;
}
/**
* get programmecode
*
* @return integer
*/
public function getProgrammeyear(){
return $this->programmeyear;
}
/**
* set startdate
*
* @param datetime $startdate
* @return Entity
*/
public function setStartdate($startdate){
$this->startdate = $startdate;
return $this;
}
/**
* get startdate
*
* @return datetime
*/
public function getStartdate(){
return $this->startdate;
}
/**
* set lastname
*
* @param string $lastname
* @return Entity
*/
public function setLastname($lastname){
$this->lastname = $lastname;
return $this;
}
/**
* get lastname
*
* @return string
*/
public function getLastname(){
return $this->lastname;
}
/**
* set building
* @param string $building
* @return Entity
*/
public function setBuilding($building){
$this->building = $building;
return $this;
}
/**
* get building
*
* @return string
*/
public function getBuilding(){
return $this->building;
}
/**
* set room
* @param integer $room
* @return Entity
*/
public function setRoom($room){
$this->room = $room;
return $this;
}
/**
* get room
*
* @return integer
*/
public function getRoom(){
return $this->room;
}
public function __construct(){
parent::__construct();
}
}
问题已解决!谢谢你的帮助!