replace gridcol object to json array in db
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace Mine\SeekerBundle\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
@@ -31,20 +30,12 @@ class GridRow
|
||||
private $grid;
|
||||
|
||||
/**
|
||||
* @var GridCol
|
||||
* @var array
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity="Mine\SeekerBundle\Entity\GridCol", mappedBy="gridCol", cascade={"persist"})
|
||||
* @ORM\JoinColumn(name="grid_row", referencedColumnName="id", onDelete="CASCADE")
|
||||
* @ORM\Column(name="grid_col", type="json_array", nullable=false)
|
||||
*/
|
||||
private $gridCol;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->gridCol = new ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id
|
||||
@@ -57,33 +48,23 @@ class GridRow
|
||||
}
|
||||
|
||||
/**
|
||||
* Add gridCol
|
||||
* Set gridCol
|
||||
*
|
||||
* @param GridCol $gridCol
|
||||
* @param array $gridCol
|
||||
*
|
||||
* @return GridRow
|
||||
*/
|
||||
public function addGridCol(GridCol $gridCol)
|
||||
public function setGridCol($gridCol)
|
||||
{
|
||||
$this->gridCol[] = $gridCol;
|
||||
$this->gridCol = $gridCol;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove gridCol
|
||||
*
|
||||
* @param GridCol $gridCol
|
||||
*/
|
||||
public function removeGridCol(GridCol $gridCol)
|
||||
{
|
||||
$this->gridCol->removeElement($gridCol);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get gridCol
|
||||
*
|
||||
* @return \Doctrine\Common\Collections\Collection
|
||||
* @return array
|
||||
*/
|
||||
public function getGridCol()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user