Rename getting-started tutorial page.
This commit is contained in:
parent
0b7d5f2813
commit
5e3e48c8dd
@ -26,7 +26,7 @@ Getting Started
|
||||
---------------
|
||||
|
||||
* **Tutorial**:
|
||||
:doc:`Getting Started <tutorials/getting-started-xml-edition>`
|
||||
:doc:`Getting Started <tutorials/getting-started>`
|
||||
|
||||
* **Reference**:
|
||||
:doc:`Introduction <reference/introduction>` |
|
||||
|
@ -135,6 +135,7 @@ following set of classes. Put them into `entities/Bug.php`,
|
||||
}
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
// User.php
|
||||
class User
|
||||
{
|
||||
@ -207,6 +208,8 @@ with the assumptions about related collections:
|
||||
|
||||
class Bug
|
||||
{
|
||||
// ... (previous code)
|
||||
|
||||
protected $products = null;
|
||||
|
||||
public function __construct()
|
||||
@ -222,6 +225,8 @@ with the assumptions about related collections:
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
class User
|
||||
{
|
||||
// ... (previous code)
|
||||
|
||||
protected $reportedBugs = null;
|
||||
protected $assignedBugs = null;
|
||||
|
||||
@ -298,6 +303,8 @@ the bi-directional reference:
|
||||
// entities/Bug.php
|
||||
class Bug
|
||||
{
|
||||
// ... (previous code)
|
||||
|
||||
protected $engineer;
|
||||
protected $reporter;
|
||||
|
||||
@ -330,6 +337,8 @@ the bi-directional reference:
|
||||
// entities/User.php
|
||||
class User
|
||||
{
|
||||
// ... (previous code)
|
||||
|
||||
protected $reportedBugs = null;
|
||||
protected $assignedBugs = null;
|
||||
|
||||
@ -383,6 +392,8 @@ the database that points from Bugs to Products.
|
||||
// entities/Bug.php
|
||||
class Bug
|
||||
{
|
||||
// ... (previous code)
|
||||
|
||||
protected $products = null;
|
||||
|
||||
public function assignToProduct($product)
|
||||
@ -450,13 +461,15 @@ the most simple one:
|
||||
// entities/Product.php
|
||||
/**
|
||||
* @Entity @Table(name="products")
|
||||
*/
|
||||
**/
|
||||
class Product
|
||||
{
|
||||
/** @Id @Column(type="integer") @GeneratedValue */
|
||||
/** @Id @Column(type="integer") @GeneratedValue **/
|
||||
protected $id;
|
||||
/** @Column(type="string") */
|
||||
/** @Column(type="string") **/
|
||||
protected $name;
|
||||
|
||||
// .. (other code)
|
||||
}
|
||||
|
||||
.. code-block:: xml
|
||||
@ -509,40 +522,42 @@ We then go on specifying the definition of a Bug:
|
||||
// entities/Bug.php
|
||||
/**
|
||||
* @Entity @Table(name="bugs")
|
||||
*/
|
||||
**/
|
||||
class Bug
|
||||
{
|
||||
/**
|
||||
* @Id @Column(type="integer") @GeneratedValue
|
||||
*/
|
||||
**/
|
||||
protected $id;
|
||||
/**
|
||||
* @Column(type="string")
|
||||
*/
|
||||
**/
|
||||
protected $description;
|
||||
/**
|
||||
* @Column(type="datetime")
|
||||
*/
|
||||
**/
|
||||
protected $created;
|
||||
/**
|
||||
* @Column(type="string")
|
||||
*/
|
||||
**/
|
||||
protected $status;
|
||||
|
||||
/**
|
||||
* @ManyToOne(targetEntity="User", inversedBy="assignedBugs")
|
||||
*/
|
||||
**/
|
||||
protected $engineer;
|
||||
|
||||
/**
|
||||
* @ManyToOne(targetEntity="User", inversedBy="reportedBugs")
|
||||
*/
|
||||
**/
|
||||
protected $reporter;
|
||||
|
||||
/**
|
||||
* @ManyToMany(targetEntity="Product")
|
||||
*/
|
||||
**/
|
||||
protected $products;
|
||||
|
||||
// ... (other code)
|
||||
}
|
||||
|
||||
.. code-block:: xml
|
||||
@ -637,33 +652,36 @@ The last missing definition is that of the User entity:
|
||||
// entities/User.php
|
||||
/**
|
||||
* @Entity @Table(name="users")
|
||||
*/
|
||||
**/
|
||||
class User
|
||||
{
|
||||
/**
|
||||
* @Id @GeneratedValue @Column(type="integer")
|
||||
* @var int
|
||||
*/
|
||||
**/
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @Column(type="string")
|
||||
* @var string
|
||||
*/
|
||||
**/
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* @OneToMany(targetEntity="Bug", mappedBy="reporter")
|
||||
* @var Bug[]
|
||||
*/
|
||||
**/
|
||||
protected $reportedBugs = null;
|
||||
|
||||
/**
|
||||
* @OneToMany(targetEntity="Bug", mappedBy="engineer")
|
||||
* @var Bug[]
|
||||
*/
|
||||
**/
|
||||
protected $assignedBugs = null;
|
||||
|
||||
// .. (other code)
|
||||
}
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<!-- config/xml/User.dcm.xml -->
|
||||
@ -1161,7 +1179,7 @@ looks like:
|
||||
|
||||
/**
|
||||
* THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE.
|
||||
*/
|
||||
**/
|
||||
class UserProxy extends \User implements \Doctrine\ORM\Proxy\Proxy
|
||||
{
|
||||
// .. lazy load code here
|
||||
@ -1411,7 +1429,7 @@ we have to adjust the metadata slightly.
|
||||
/**
|
||||
* @Entity(repositoryClass="BugRepository")
|
||||
* @Table(name="bugs")
|
||||
*/
|
||||
**/
|
||||
class Bug
|
||||
{
|
||||
//...
|
Loading…
x
Reference in New Issue
Block a user