57 lines
970 B
PHP
57 lines
970 B
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
/**
|
|
* @ORM\Entity
|
|
* @ORM\Table(name="cmb_legacy_job_order_row")
|
|
*/
|
|
class CMBLegacyJobOrderRow
|
|
{
|
|
// unique id
|
|
/**
|
|
* @ORM\Id
|
|
* @ORM\Column(type="integer")
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
*/
|
|
protected $id;
|
|
|
|
// data from csv file
|
|
/**
|
|
* @ORM\Column(type="json")
|
|
*/
|
|
protected $data;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->data = [];
|
|
}
|
|
|
|
public function addData($id, $value)
|
|
{
|
|
$this->data[$id] = $value;
|
|
return $this;
|
|
}
|
|
|
|
public function setData(array $data_array)
|
|
{
|
|
$this->data = $data_array;
|
|
return $this;
|
|
}
|
|
|
|
public function getDataById($id)
|
|
{
|
|
// return null if we don't have it
|
|
if (!isset($this->data[$id]))
|
|
return null;
|
|
|
|
return $this->data[$id];
|
|
}
|
|
|
|
public function getData()
|
|
{
|
|
return $this->data;
|
|
}
|
|
}
|