我的Symfony項目中有一個實體存在大問題。學說實體代理異常
某些代碼第一: 地址實體
<?php
namespace AppBundle\Entity;
class Address
{
/**
* @var integer
*/
private $id;
/**
* @var string
*/
private $street;
/**
* @var string|null
*/
private $postalCode;
/**
* @var string|null
*/
private $city;
/**
* @var string|null
*/
private $province;
/**
* @var float
*/
private $latitude;
/**
* @var float
*/
private $longtitude;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set street
*
* @param string $street
* @return Address
*/
public function setStreet($street)
{
$this->street = $street;
return $this;
}
/**
* Get street
*
* @return string
*/
public function getStreet()
{
return $this->street;
}
/**
* Set postalCode
*
* @param integer $postalCode
* @return Address
*/
public function setPostalCode($postalCode)
{
$this->postalCode = $postalCode;
return $this;
}
/**
* Get postalCode
*
* @return integer
*/
public function getPostalCode()
{
return $this->postalCode;
}
/**
* Set city
*
* @param string $city
* @return Address
*/
public function setCity($city)
{
$this->city = $city;
return $this;
}
/**
* Get city
*
* @return string
*/
public function getCity()
{
return $this->city;
}
/**
* Set province
*
* @param string $province
* @return Address
*/
public function setProvince($province)
{
$this->province = $province;
return $this;
}
/**
* Get province
*
* @return string
*/
public function getProvince()
{
return $this->province;
}
/**
* Set latitude
*
* @param string $latitude
* @return Address
*/
public function setLatitude($latitude)
{
$this->latitude = $latitude;
return $this;
}
/**
* Get latitude
*
* @return string
*/
public function getLatitude()
{
return $this->latitude;
}
/**
* Set longtitude
*
* @param string $longtitude
* @return Address
*/
public function setLongtitude($longtitude)
{
$this->longtitude = $longtitude;
return $this;
}
/**
* Get longtitude
*
* @return string
*/
public function getLongtitude()
{
return $this->longtitude;
}
}
地址實體映射:
AppBundle\Entity\Address:
type: entity
table: addresses
id:
id:
type: integer
generator:
strategy: AUTO
fields:
street:
type: string
nullable: false
postalCode:
name: postal_code
type: string
nullable: true
city:
type: string
nullable: false
province:
type: string
nullable: true
latitude:
type: decimal
scale: 12
precision: 18
nullable: true
longtitude:
type: decimal
scale: 12
precision: 18
nullable: true
地點實體映射: 的appbundle \實體\地點(縮短例如起見):
type: entity
table: venues
manyToOne:
address:
targetEntity: AppBundle\Entity\Address
joinColumn:
name: address_id
referencedColumnName: id
nullable: false
cascade: ["persist"]
問題是我面對一個前ception被拋出:
通知:Array對字符串的轉換500內部服務器錯誤 - ContextErrorException 這裏
$proxyCode = strtr($this->proxyClassTemplate, $venueholders);
(在供應商/教義/普通/ LIB /學說/普通/代理/ ProxyGenerator.php在線路280)。
當我刪除關係時,一切工作正常,所以它告訴我有Address實體的某種問題。
我試圖清除緩存 - 沒有運氣。映射看起來對我來說沒問題,getters/setters是正確的。
任何提示?
是的!明白了!我用「場地」替換了「場所」,但我完全忘記了這一點,我確信我只將變化應用到了'src'目錄!你們兩個。 – user1854344