Does not the doctrine due to the fact that the read and write properties using __call(), can we bypass that?

I have no Symphony, there is something similar there https://symfony.com/doc/current/components/propert...
static $fields = [
 'id', 'code', 'fullName', 'number', 'color',
 'series', 'weight', 'volume', 'status', 'specStatus', 'type', 'urgency'
];
 public function __call($nameFunction, $arguments)
{
 if (strlen($nameFunction) < 4):
return;
endif;
 $prefix = substr($nameFunction, 0, 3);
 $name = lcfirst(substr($nameFunction, 3, strlen($nameFunction) - 3));
 $inFields = array_search($name, self::$fields);
 if ($prefix == 'get'):
 if ($inFields):
 return $this->$name;
endif;
endif;
 if ($prefix == 'set'):
 if ($inFields):
 $value = $arguments[0];
 $this->$name = $value;
endif;
endif;
 }

It normally gets the values and writes, but the Association OneToMany, etc it produces a void.
Breaks down on Proxy.
To circumvent this problem, really don't want to write setters and don't want to use the annotation (comment must be a comment).
And yaml to write the functions lazy))
June 5th 19 at 21:35

Find more questions by tags Doctrine ORM