Private
Public Access
1
0

replace gridcol object to json array in db

This commit is contained in:
2016-11-01 13:41:30 +01:00
parent 31e3097da3
commit 2ed938f22a
4 changed files with 17 additions and 165 deletions

View File

@@ -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()
{