-1
訪問類型我得到這個錯誤:Symfony的 - 無法確定財產「ID」
Could not determine access type for property "id"
然後我說我需要添加一組功能ID在互聯網上閱讀。但那隻會導致其他錯誤。
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Product
*
* @ORM\Table(name="product")
* @ORM\Entity(repositoryClass="AppBundle\Repository\ProductRepository")
*/
class Product
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var int
*
* @ORM\ManyToOne(targetEntity="Categorie", inversedBy=」producten」)
* @ORM\JoinColumn(name="categorie", referencedColumnName="id")
*/
private $categorie;
/**
* @var string
*
* @ORM\Column(name="naam", type="string", length=100, nullable=true)
*/
private $naam;
/**
* @var string
*
* @ORM\Column(name="merk", type="string", length=100, nullable=true)
*/
private $merk;
/**
* @var string
*
* @ORM\Column(name="inkoopprijs", type="decimal", precision=10, scale=2, nullable=true)
*/
private $inkoopprijs;
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set categorie
*
* @param integer $categorie
*
* @return Product
*/
public function setCategorie($categorie)
{
$this->categorie = $categorie;
return $this;
}
/**
* Get categorie
*
* @return int
*/
public function getCategorie()
{
return $this->categorie;
}
/**
* Set naam
*
* @param string $naam
*
* @return Product
*/
public function setNaam($naam)
{
$this->naam = $naam;
return $this;
}
/**
* Get naam
*
* @return string
*/
public function getNaam()
{
return $this->naam;
}
/**
* Set merk
*
* @param string $merk
*
* @return Product
*/
public function setMerk($merk)
{
$this->merk = $merk;
return $this;
}
/**
* Get merk
*
* @return string
*/
public function getMerk()
{
return $this->merk;
}
/**
* Set inkoopprijs
*
* @param string $inkoopprijs
*
* @return Product
*/
public function setInkoopprijs($inkoopprijs)
{
$this->inkoopprijs = $inkoopprijs;
return $this;
}
/**
* Get inkoopprijs
*
* @return string
*/
public function getInkoopprijs()
{
return $this->inkoopprijs;
}
}
請顯示導致錯誤的代碼。 – ehymel
您可以添加錯誤的完整堆棧跟蹤以及出現的位置/位置。另請閱讀[我如何問一個好問題?](http://stackoverflow.com/help/how-to-ask)。 –
您可以嘗試使用[app_dev.php] URL [描述在此](http://symfony.com/doc/current/configuration/environments.html#executing-an-application-in-different-environments)來查看如果你可以像@gp_sflover一樣詢問堆棧跟蹤?它可能會幫助你看到問題出在哪裏。 –