Advertisement
Device-Cheat

symfony model second

Apr 24th, 2020
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. <?php
  2. // src/BlogBundle/Entity/Post.php
  3. namespace BlogBundle\Entity;
  4.  
  5. use Doctrine\ORM\Mapping as ORM;
  6.  
  7. /**
  8.  * Post
  9.  *
  10.  * @ORM\Table(name="post")
  11.  * @ORM\Entity(repositoryClass="BlogBundle\Repository\PostRepository")
  12.  */
  13. class Post
  14. {
  15.     /**
  16.      * @var int
  17.      *
  18.      * @ORM\Column(name="id", type="integer")
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue(strategy="AUTO")
  21.      */
  22.     protected $id;
  23.  
  24.     /**
  25.      * @var string
  26.      *
  27.      * @ORM\Column(name="title", type="string", length=255)
  28.      */
  29.     protected $title;
  30.  
  31.     /**
  32.      * @var string
  33.      *
  34.      * @ORM\Column(name="content", type="text")
  35.      */
  36.     protected $content;
  37.  
  38.     /**
  39.      * @var User
  40.      *
  41.      * @ORM\ManyToOne(targetEntity="BlogBundle\Entity\User")
  42.      * @ORM\JoinColumn(name="author_id", referencedColumnName="id")
  43.      */
  44.     protected $author;
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. http://github.com/shfx17
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement