I have an entity:
<?php
namespace App\Entity\Aero;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\Aero\ScheduleRepository")
*/
class Schedule
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="date")
*/
private $dateOfFlight;
/**
* @ORM\Column(type="json")
*/
private $timeOfFlightAndStations = [];
public function getId(): ?int
{
return $this->id;
}
public function getDateOfFlight(): ?\DateTimeInterface
{
return $this->dateOfFlight;
}
public function setDateOfFlight(\DateTimeInterface $dateOfFlight): self
{
$this->dateOfFlight = $dateOfFlight;
return $this;
}
public function getTimeOfFlightAndStations(): ?array
{
return $this->timeOfFlightAndStations;
}
public function setTimeOfFlightAndStations(array $timeOfFlightAndStations): self
{
$this->timeOfFlightAndStations = $timeOfFlightAndStations;
return $this;
}
}
When I try to add field with type json_array via con make:entity
it shows me error:
[ERROR] Invalid type "json_array".
My computer says that type "json_array" is invalid, but also says that it is in the list of valid types. How is it possible?
Please, help me, how to deal with this error? Sorry, can't add more code on entity because of restrictions.