Skip to content

Commit

Permalink
Merge pull request #558 from MrYamous/doc/add-attributes-example
Browse files Browse the repository at this point in the history
Add attributes example for entity in documentation
  • Loading branch information
SenseException authored Nov 6, 2024
2 parents b9712ed + ab2a5b5 commit 628ac3b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Resources/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,26 @@ for Doctrine's ORM:

.. configuration-block::

.. code-block:: php-attributes
// src/Entity/User.php
namespace App\Entity;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[Entity]
#[Table(name: 'user')]
class User
{
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
#[ORM\Column(type: Types:INT)]
private $id;
#[ORM\Column(type: Types:STRING, length: 255)]
private $name;
.. code-block:: php-annotations
// src/Entity/User.php
Expand Down

0 comments on commit 628ac3b

Please sign in to comment.