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;
- /**
- * Books
- *
- * @ORM\Table(name="books")
- * @ORM\Entity
- */
- class Book 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="ttile", type="string", length=255, nullable=false)
- */
- private $ttile;
- /**
- * @var string
- *
- * @ORM\Column(name="isbn", type="string", length=255, nullable=false)
- */
- private $isbn;
- /**
- * @var \Doctrine\Common\Collections\Collection
- *
- * @ORM\ManyToMany(targetEntity="App\CoreBundle\Entity\Authors", inversedBy="book", cascade={"persist","remove","detach","merge","refresh"})
- * @ORM\JoinTable(name="author_books",
- * joinColumns={
- * @ORM\JoinColumn(name="book_id", referencedColumnName="id")
- * },
- * inverseJoinColumns={
- * @ORM\JoinColumn(name="author_id", referencedColumnName="id")
- * }
- * )
- */
- private $author;
- /**
- * Constructor
- */
- public function __construct()
- {
- $this->author = new \Doctrine\Common\Collections\ArrayCollection();
- }
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set ttile
- *
- * @param string $ttile
- * @return Books
- */
- public function setTtile($ttile)
- {
- $this->ttile = $ttile;
- return $this;
- }
- /**
- * Get ttile
- *
- * @return string
- */
- public function getTtile()
- {
- return $this->ttile;
- }
- /**
- * Set isbn
- *
- * @param string $isbn
- * @return Books
- */
- public function setIsbn($isbn)
- {
- $this->isbn = $isbn;
- return $this;
- }
- /**
- * Get isbn
- *
- * @return string
- */
- public function getIsbn()
- {
- return $this->isbn;
- }
- /**
- * Add author
- *
- * @param \App\CoreBundle\Entity\Authors $author
- * @return Books
- */
- public function addAuthor(\App\CoreBundle\Entity\Authors $author)
- {
- $this->author[] = $author;
- return $this;
- }
- /**
- * Remove author
- *
- * @param \App\CoreBundle\Entity\Authors $author
- */
- public function removeAuthor(\App\CoreBundle\Entity\Authors $author)
- {
- $this->author->removeElement($author);
- }
- /**
- * Get author
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getAuthor()
- {
- return $this->author;
- }
- public function setCachable($isChachable)
- {
- $this->_isCachable = $isChachable;
- }
- public function isCachable()
- {
- return $this->_isCachable;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement