Problem is here : Could not determine access type for property "rowElementData" in class "App\Entity\ReportSchemaRowElement". When i change $rowElementData for public this error isnt show up. I know its not correct solution. I dont understand why symfony cannot access to this property, i have methods like for a $rowElementDimensions or $rowElementProperty and this relations are same..
This is my entity code: App\Entity\ReportSchemaRowElement
<?php
namespace App\Entity;
use ...
/**
* @ORM\Entity(repositoryClass=ReportSchemaRowElementRepository::class)
* @ORM\HasLifecycleCallbacks()
*/
class ReportSchemaRowElement
{
use UuidGenerator;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups("listing")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=ReportSchemaRow::class, inversedBy="reportSchemaRowElements")
*/
private $row;
/**
* @ORM\Column(type="string", length=255)
* @Groups("listing")
*/
private $name;
/**
* @ORM\Column(type="string", length=255)
* @Groups("listing")
*/
private $type;
/**
* @ORM\Column(type="integer")
* @Assert\LessThan(5)
* @Assert\GreaterThan(0)
* @Groups("listing")
*/
private $size;
/**
* @ORM\Column(type="integer")
* @Groups("listing")
*/
private $priority;
/**
* @ORM\Column(type="text")
*/
private $uuid;
/**
* @ORM\OneToMany(targetEntity=RowElementProperty::class, mappedBy="element", cascade={"persist", "remove"})
* @Groups("listing")
*/
private $rowElementProperty;
/**
* @ORM\OneToMany(targetEntity=RowElementDimension::class, mappedBy="element", cascade={"persist", "remove"})
* @Groups("listing")
*/
private $rowElementDimensions;
/**
* @ORM\OneToMany(targetEntity=RowElementData::class, mappedBy="element", cascade={"persist", "remove"})
* @Groups("listing")
*/
private $rowElementData;
public function __construct()
{
$this->rowElementProperty = new ArrayCollection();
$this->rowElementDimensions = new ArrayCollection();
$this->rowElementData = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getRow(): ?ReportSchemaRow
{
return $this->row;
}
public function setRow(?ReportSchemaRow $row): self
{
$this->row = $row;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): self
{
$this->type = $type;
return $this;
}
public function getSize(): ?int
{
return $this->size;
}
public function setSize(int $size): self
{
$this->size = $size;
return $this;
}
public function getPriority(): ?int
{
return $this->priority;
}
public function setPriority(int $priority): self
{
$this->priority = $priority;
return $this;
}
public function getUuid(): ?string
{
return $this->uuid;
}
public function setUuid(string $uuid): self
{
$this->uuid = $uuid;
return $this;
}
/**
* Tworzy i ustawia UUID na podstawie hostname oraz unikalnego ID z php.
* @ORM\PrePersist
*/
public function generateUuid()
{
if ($this->getUuid() === null) {
$this->makeUuid($this->getName());
}
}
/**
* @return Collection|RowElementProperty[]
*/
public function getRowElementProperty(): Collection
{
return $this->rowElementProperty;
}
public function addRowElementProperty(RowElementProperty $rowElementProperty): self
{
if (!$this->rowElementProperty->contains($rowElementProperty)) {
$this->rowElementProperty[] = $rowElementProperty;
$rowElementProperty->setElement($this);
}
return $this;
}
public function removeRowElementProperty(RowElementProperty $rowElementProperty): self
{
if ($this->rowElementProperty->removeElement($rowElementProperty)) {
// set the owning side to null (unless already changed)
if ($rowElementProperty->getElement() === $this) {
$rowElementProperty->setElement(null);
}
}
return $this;
}
/**
* @return Collection|RowElementDimension[]
*/
public function getRowElementDimensions(): Collection
{
return $this->rowElementDimensions;
}
public function addRowElementDimension(RowElementDimension $rowElementDimension): self
{
if (!$this->rowElementDimensions->contains($rowElementDimension)) {
$this->rowElementDimensions[] = $rowElementDimension;
$rowElementDimension->setElement($this);
}
return $this;
}
public function removeRowElementDimension(RowElementDimension $rowElementDimension): self
{
if ($this->rowElementDimensions->removeElement($rowElementDimension)) {
// set the owning side to null (unless already changed)
if ($rowElementDimension->getElement() === $this) {
$rowElementDimension->setElement(null);
}
}
return $this;
}
/**
* @return Collection|RowElementData[]
*/
public function getRowElementData(): Collection
{
return $this->rowElementData;
}
public function addRowElementData(RowElementData $rowElementData): self
{
if (!$this->rowElementData->contains($rowElementData)) {
$this->rowElementData[] = $rowElementData;
$rowElementData->setElement($this);
}
return $this;
}
public function removeRowElementData(RowElementData $rowElementData): self
{
if ($this->rowElementData->removeElement($rowElementData)) {
// set the owning side to null (unless already changed)
if ($rowElementData->getElement() === $this) {
$rowElementData->setElement(null);
}
}
return $this;
}
}