2016-10-21 23:30:41 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Mine\SeekerBundle\Entity;
|
|
|
|
|
|
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Grid
|
|
|
|
|
*
|
|
|
|
|
* @ORM\Table(name="grid")
|
|
|
|
|
* @ORM\Entity(repositoryClass="Mine\SeekerBundle\Repository\GridRepository")
|
|
|
|
|
*/
|
|
|
|
|
class Grid
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @var int
|
|
|
|
|
*
|
|
|
|
|
* @ORM\Column(name="id", type="integer")
|
|
|
|
|
* @ORM\Id
|
|
|
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
|
|
|
*/
|
|
|
|
|
private $id;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @var PlayedGame
|
|
|
|
|
*
|
2016-10-25 11:19:50 +02:00
|
|
|
* @ORM\OneToOne(targetEntity="Mine\SeekerBundle\Entity\PlayedGame", inversedBy="grid", cascade={"persist"})
|
2016-10-21 23:30:41 +02:00
|
|
|
*/
|
|
|
|
|
private $playedGame;
|
|
|
|
|
|
|
|
|
|
/**
|
2016-10-25 11:19:50 +02:00
|
|
|
* @var GridCol
|
2016-10-21 23:30:41 +02:00
|
|
|
*
|
2016-10-25 11:19:50 +02:00
|
|
|
* @ORM\OneToMany(targetEntity="Mine\SeekerBundle\Entity\GridRow", mappedBy="grid", cascade={"persist"})
|
|
|
|
|
* @ORM\JoinColumn(name="grid_row", referencedColumnName="id", onDelete="CASCADE")
|
2016-10-21 23:30:41 +02:00
|
|
|
*/
|
2016-10-25 11:19:50 +02:00
|
|
|
private $gridRow;
|
|
|
|
|
|
2016-10-21 23:30:41 +02:00
|
|
|
/**
|
|
|
|
|
* Constructor
|
|
|
|
|
*/
|
|
|
|
|
public function __construct()
|
|
|
|
|
{
|
2016-10-25 11:19:50 +02:00
|
|
|
$this->gridRow = new ArrayCollection();
|
2016-10-21 23:30:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2016-10-25 11:19:50 +02:00
|
|
|
* Get id
|
2016-10-21 23:30:41 +02:00
|
|
|
*
|
2016-10-25 11:19:50 +02:00
|
|
|
* @return integer
|
2016-10-21 23:30:41 +02:00
|
|
|
*/
|
2016-10-25 11:19:50 +02:00
|
|
|
public function getId()
|
2016-10-21 23:30:41 +02:00
|
|
|
{
|
2016-10-25 11:19:50 +02:00
|
|
|
return $this->id;
|
2016-10-21 23:30:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2016-10-25 11:19:50 +02:00
|
|
|
* Set playedGame
|
2016-10-21 23:30:41 +02:00
|
|
|
*
|
2016-10-25 11:19:50 +02:00
|
|
|
* @param PlayedGame $playedGame
|
2016-10-21 23:30:41 +02:00
|
|
|
*
|
|
|
|
|
* @return Grid
|
|
|
|
|
*/
|
2016-10-25 11:19:50 +02:00
|
|
|
public function setPlayedGame(PlayedGame $playedGame = null)
|
2016-10-21 23:30:41 +02:00
|
|
|
{
|
2016-10-25 11:19:50 +02:00
|
|
|
$this->playedGame = $playedGame;
|
2016-10-21 23:30:41 +02:00
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2016-10-25 11:19:50 +02:00
|
|
|
* Get playedGame
|
2016-10-21 23:30:41 +02:00
|
|
|
*
|
2016-10-25 11:19:50 +02:00
|
|
|
* @return PlayedGame
|
2016-10-21 23:30:41 +02:00
|
|
|
*/
|
2016-10-25 11:19:50 +02:00
|
|
|
public function getPlayedGame()
|
2016-10-21 23:30:41 +02:00
|
|
|
{
|
2016-10-25 11:19:50 +02:00
|
|
|
return $this->playedGame;
|
2016-10-21 23:30:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2016-10-25 11:19:50 +02:00
|
|
|
* Add gridRow
|
2016-10-21 23:30:41 +02:00
|
|
|
*
|
2016-10-25 11:19:50 +02:00
|
|
|
* @param GridCol $gridRow
|
2016-10-21 23:30:41 +02:00
|
|
|
*
|
|
|
|
|
* @return Grid
|
|
|
|
|
*/
|
2016-10-25 11:19:50 +02:00
|
|
|
public function addGridRow(GridCol $gridRow)
|
2016-10-21 23:30:41 +02:00
|
|
|
{
|
2016-10-25 11:19:50 +02:00
|
|
|
$this->gridRow[] = $gridRow;
|
2016-10-21 23:30:41 +02:00
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2016-10-25 11:19:50 +02:00
|
|
|
* Remove gridRow
|
2016-10-21 23:30:41 +02:00
|
|
|
*
|
2016-10-25 11:19:50 +02:00
|
|
|
* @param GridCol $gridRow
|
2016-10-21 23:30:41 +02:00
|
|
|
*/
|
2016-10-25 11:19:50 +02:00
|
|
|
public function removeGridRow(GridCol $gridRow)
|
2016-10-21 23:30:41 +02:00
|
|
|
{
|
2016-10-25 11:19:50 +02:00
|
|
|
$this->gridRow->removeElement($gridRow);
|
2016-10-21 23:30:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2016-10-25 11:19:50 +02:00
|
|
|
* Get gridRow
|
2016-10-21 23:30:41 +02:00
|
|
|
*
|
|
|
|
|
* @return \Doctrine\Common\Collections\Collection
|
|
|
|
|
*/
|
2016-10-25 11:19:50 +02:00
|
|
|
public function getGridRow()
|
2016-10-21 23:30:41 +02:00
|
|
|
{
|
2016-10-25 11:19:50 +02:00
|
|
|
return $this->gridRow;
|
2016-10-21 23:30:41 +02:00
|
|
|
}
|
|
|
|
|
}
|