Hello:
I want to be able to get and set the date using my own date format (dd/mm/yyyy) and not doctrine (yyyy-mm-dd). I've found a way that is specifying a getter and setter for every date field however I want do it in a more convenient way (1 setter + 1 getter for every date field in every table is a lot)
class Curs extends BaseCurs {
private function fechaDesdeEsp($fecha){
$fecha = new DateTime($fecha);
return $fecha->format('Y-m-d');
}
private function fechaDesdeIso($fecha){
$fecha = new DateTime($fecha);
return $fecha->format('d/m/Y');
}
public function setFechainici($fecha_inici) {
return $this->_set('fecha_inici', $this->fechaDesdeEsp($fecha_inici));
}
public function getFechainici() {
return $this->fechaDesdeIso($this->_get('fecha_inici'));
}
}
Hope you find a solution, Thanks in Advance