Where are setters/getters when using YAML/XML mapping for Doctrine in Symfony?
In Symfony2, when adding mapping information to tell Doctrine how to map my entity to the database, if I use YAML or XML format instead of PHP annotations, how/where do I write getters/setters/other functions?
you can define mapping in yml or xml and still define entity class methods in the .php
Symfony docs show the metadata as annotations directly inside the Product class (option #1 PHP) at a different location src/AppBundle/Entity/Product.php than alternative (option #2 YAML and #3 XML) src/AppBundle/Resources/config/doctrine/Product.orm.*ml. This suggests that you can define the mapping in *ml and the getters/setters/other functions in the php.
Notice in the docs example the AppBundle\Entity\Product is specified in both files. The class methods and mapping can be defined independently and related to each other as AppBundle\Entity\Product.
Doctrine requires private/protected properties, so you'll still be writing getters and setters. And you'll still be writing the mapping info, just in another place.