Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

change targetEntity format (alternate)#10702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
osavchenko wants to merge1 commit intosymfony:masterfromosavchenko:alternate_changes_according_to_doctrine2
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletionbest_practices/business-logic.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -154,6 +154,7 @@ looking for mapping information::

namespace App\Entity;

use App\Entity\Comment;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;

Expand DownExpand Up@@ -198,7 +199,7 @@ looking for mapping information::

/**
* @ORM\OneToMany(
* targetEntity="Comment",
* targetEntity="Comment::class",
* mappedBy="post",
* orphanRemoval=true
* )
Expand Down
10 changes: 7 additions & 3 deletionsdoctrine/associations.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -145,13 +145,15 @@ the ``Product`` entity (and getter & setter methods):

// src/Entity/Product.php

use App\Entity\Category;

// ...
class Product
{
// ...

/**
* @ORM\ManyToOne(targetEntity="App\Entity\Category", inversedBy="products")
* @ORM\ManyToOne(targetEntity="Category::class", inversedBy="products")
*/
private $category;

Expand DownExpand Up@@ -216,6 +218,7 @@ class that will hold these objects:
// src/Entity/Category.php

// ...
use App\Entity\Product;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;

Expand All@@ -224,7 +227,7 @@ class that will hold these objects:
// ...

/**
* @ORM\OneToMany(targetEntity="App\Entity\Product", mappedBy="category")
* @ORM\OneToMany(targetEntity="Product::class", mappedBy="category")
*/
private $products;

Expand DownExpand Up@@ -568,10 +571,11 @@ that behavior, use the `orphanRemoval`_ option inside ``Category``::

// src/Entity/Category.php

use App\Entity\Product;
// ...

/**
* @ORM\OneToMany(targetEntity="App\Entity\Product", mappedBy="category", orphanRemoval=true)
* @ORM\OneToMany(targetEntity="Product::class", mappedBy="category", orphanRemoval=true)
*/
private $products;

Expand Down
2 changes: 1 addition & 1 deletiondoctrine/resolve_target_entity.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -75,7 +75,7 @@ An Invoice entity::
class Invoice
{
/**
* @ORM\ManyToOne(targetEntity="Acme\InvoiceBundle\Model\InvoiceSubjectInterface")
* @ORM\ManyToOne(targetEntity="InvoiceSubjectInterface::class")
* @var InvoiceSubjectInterface
*/
protected $subject;
Expand Down
3 changes: 2 additions & 1 deletionform/form_collections.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -465,10 +465,11 @@ you will learn about next!).

// src/Entity/Task.php

use App\Entity\Tag;
// ...

/**
* @ORM\ManyToMany(targetEntity="Tag", cascade={"persist"})
* @ORM\ManyToMany(targetEntity="Tag::class", cascade={"persist"})
*/
protected $tags;

Expand Down
3 changes: 2 additions & 1 deletionreference/constraints/UniqueEntity.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -204,6 +204,7 @@ Consider this example:
// src/Entity/Service.php
namespace App\Entity;

use App\Entity\Host;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;

Expand All@@ -218,7 +219,7 @@ Consider this example:
class Service
{
/**
* @ORM\ManyToOne(targetEntity="Host")
* @ORM\ManyToOne(targetEntity="Host::class")
*/
public $host;

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp