Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\CoreBundle\Entity;
- use App\CoreBundle\RedisLayer\Marks\Insert;
- use App\CoreBundle\RedisLayer\Marks\Update;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * Authors
- *
- * @ORM\Table(name="authors")
- * @ORM\Entity
- */
- class Author implements Insert, Update
- {
- private $_isCachable = true;
- /**
- * @var integer
- *
- * @ORM\Column(name="id", type="integer", nullable=false)
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="IDENTITY")
- */
- private $id;
- /**
- * @var string
- *
- * @ORM\Column(name="name", type="string", length=255, nullable=false)
- */
- private $name;
- /**
- * @var \Doctrine\Common\Collections\Collection
- *
- * @ORM\ManyToMany(targetEntity="App\CoreBundle\Entity\Books", mappedBy="author", cascade={"persist","remove","detach","merge","refresh"})
- */
- private $book;
- /**
- * Constructor
- */
- public function __construct()
- {
- $this->book = new \Doctrine\Common\Collections\ArrayCollection();
- }
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set name
- *
- * @param string $name
- * @return Authors
- */
- public function setName($name)
- {
- $this->name = $name;
- return $this;
- }
- /**
- * Get name
- *
- * @return string
- */
- public function getName()
- {
- return $this->name;
- }
- /**
- * Add book
- *
- * @param \App\CoreBundle\Entity\Books $book
- * @return Authors
- */
- public function addBook(\App\CoreBundle\Entity\Books $book)
- {
- $book->addAuthor($this);
- $this->book[] = $book;
- return $this;
- }
- /**
- * Remove book
- *
- * @param \App\CoreBundle\Entity\Books $book
- */
- public function removeBook(\App\CoreBundle\Entity\Books $book)
- {
- $this->book->removeElement($book);
- }
- /**
- * Get book
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getBook()
- {
- return $this->book;
- }
- public function setCachable($isChachable)
- {
- $this->_isCachable = $isChachable;
- }
- public function isCachable()
- {
- return $this->_isCachable;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement