Answer the question
In order to leave comments, you need to log in
How to set json value?
/**
* @ORM\Entity(repositoryClass=DeliveryRepository::class)
*/
class Delivery {
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="json", nullable=true)
*/
private json = [];
public function getJson()
{
return $this->json;
}
public function setJson($json): self
{
$this->json = $json;
return $this;
}
}
$d=new Delivery();
$d->setJson(["fff"=>["ff"=>[1,3]],"hh3"=>[7,8]]); // пробовала 1
$d->setJson(["fff"]); // пробовала 2
Call to a member function setJson() on array
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question