public function crearSeccion(Encuesta_Model_Seccion $seccion) { $tablaSeccion = $this->tablaSeccion; $select = $tablaSeccion->select()->from($tablaSeccion)->where("idEncuesta = ?", $seccion->getIdEncuesta()); $orden = count($tablaSeccion->fetchAll($select)); $orden++; $seccion->setOrden($orden); $seccion->setElementos("0"); $seccion->setHash($seccion->getHash()); $seccion->setFecha(date("Y-m-d H:i:s", time())); $tablaSeccion->insert($seccion->toArray()); }