Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It's a good practice to allways declare your class' members private and to generate getters and setters on your class members.</p> <p>In your case, you don't generate getters and setters (there is no <code>getId()</code> method on your <code>NewCategory</code> class).</p> <p>That's how your <code>NewCategory</code> class should look like :</p> <pre><code>/** @Entity @Table(name="news_category") */ class NewsCategory { /** * @Id @GeneratedValue @Column(type="integer") * @var integer */ private $id; /** * @Column(type="string", length=50, unique=TRUE) * @var string */ private $name; /** * @OneToMany(targetEntity="News", mappedBy="category") */ private $news; public function __construct() { $this-&gt;news = new \Doctrine\Common\Collections\ArrayCollection; } public function getId(){ return $this-&gt;id;} public function setId($id){ $this-&gt;id = $id;} public function setName($name) { $this-&gt;name = $name; } public function getName() { return $this-&gt;name; } public function setNews($news) {$this-&gt;news = $news;} public function getNews() { return $this-&gt;news; } } </code></pre> <p>The generated proxies will not generate <em>magically</em> getters and setters on every of your properties (it would break the OOP's encapsulation principle). You can find more documentations about proxies here : <a href="http://www.doctrine-project.org/docs/orm/2.0/en/reference/configuration.html#proxy-objects" rel="nofollow">http://www.doctrine-project.org/docs/orm/2.0/en/reference/configuration.html#proxy-objects</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload