public function getAll() { $conexion = new Conexion(); $consulta = $conexion->prepare('SELECT * FROM ' . self::TABLA); $consulta->execute(); while ($registro = $consulta->fetch()) { $tipo = new Tipo(); $tipo->construir($registro); $array[] = $tipo; } return $array; }