![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
20/02/2011, 21:17
|
| | Fecha de Ingreso: abril-2009
Mensajes: 1
Antigüedad: 15 años, 9 meses Puntos: 0 | |
Respuesta: DataMapper en ZF, sin Orm puedes hacerlo como ya dijeron con getters y setters y así manejar todos los campos de tu tabla como si fueran objetos
utilizando algo parecido
function __get ($name)
{
$method = "get" . $name;
if (! method_exists($this, $method)) {
throw new Exception('Invalid property ' . $name);
}
return $this->$method();
}
function __set ($name, $value)
{
$method = 'set' . $name;
if (! method_exists($this, $method)) {
throw new Exception('Invalid property '. $name);
}
$this->$method($value);
}
$table->titulo = "Titulo"
$table->save();
igual usando $_referenceMap y $_dependentTables para armar tu datamapper |