When I run doctrine orm:validate-schema, it pops up a bunch of warnings about my mapped columns being public and not using getter/setter methods to wrap them. I
Note that Doctrine 2.4 now supports proxy objects for entites with public properties.
Marco Pivetta's website explains how it works:
class Customer {
public $name;
public $surname;
}
class CustomerProxy extends Customer {
public function __construct(Customer $customer) {
unset($this->name, $this->surname);
$this->customer = $customer;
}
public function __set($name, $value) {
$this->customer->$name = $value;
}
public function __get($name) {
return $this->customer->$name;
}
// __isset, __unset, __clone, __sleep, __wakeup (or serialize/unserialize)
}