Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/10/2014, 03:04
jc1992
 
Fecha de Ingreso: noviembre-2010
Mensajes: 156
Antigüedad: 13 años, 5 meses
Puntos: 0
Problemas con .yml

Buenos días!

Estoy probando y trasteando con symfony ya que veo que es un framework potentísimo y me encuentro en el problema de los archivos .yml

Quiero pasarme a estos archivos porque utilizo MySQL WorkBench 5.2 que te genera el .yml automáticamente.

Ahora mi pregunta es ? Para utilizar el archivo .yml que te genera WorkBench lo hemos de tratar como una Entity?

Mi pregunta será si con este archivo se podría generar el CRUD de manera automática igual que cuando utilizaba las clases o confundo conceptos?

Aquí dejo el contenido del archivo generado

PD:Utilizo Symfony 2.3
---
Código PHP:
Ver original
  1. detect_relations: true
  2. options:
  3.   collate: utf8_general_ci
  4.   charset: utf8
  5.   type: InnoDB
  6.  
  7. Cliente:
  8.   columns:
  9.     idCliente:
  10.       type: integer(4)
  11.       primary: true
  12.       notnull: true
  13.       autoincrement: true
  14.     nombre:
  15.       type: string(45)
  16.       notnull: true
  17.     apellido:
  18.       type: string(45)
  19.       notnull: true
  20.     date:
  21.       type: string(45)
  22.       notnull: true
  23.     direccion:
  24.       type: string(45)
  25.       notnull: true
  26.  
  27. Venta:
  28.   tableName: Ventas
  29.   columns:
  30.     idVentas:
  31.       type: integer(4)
  32.       primary: true
  33.       notnull: true
  34.     Fecha:
  35.       type: date
  36.       notnull: true
  37.     id_Cliente:
  38.       type: integer(4)
  39.       notnull: true
  40.   relations:
  41.     idCliente:
  42.       class: Cliente
  43.       local: id_Cliente
  44.       foreign: idCliente
  45.       foreignAlias: Ventas
  46.   indexes:
  47.     IdCliente_idx:
  48.       fields: [id_Cliente]
  49.  
  50. DetalleVenta:
  51.   columns:
  52.     idDetalleVenta:
  53.       type: integer(4)
  54.       primary: true
  55.       notnull: true
  56.       autoincrement: true
  57.     idVenta:
  58.       type: integer(4)
  59.       notnull: true
  60.     idProducto:
  61.       type: integer(4)
  62.       notnull: true
  63.     cantidad:
  64.       type: integer(4)
  65.       notnull: true
  66.     Descuento:
  67.       type: decimal(18)
  68.       scale: 2
  69.       notnull: true
  70.   relations:
  71.     idVenta:
  72.       class: Venta
  73.       local: idVenta
  74.       foreign: idVentas
  75.       foreignAlias: DetalleVentas
  76.     idProducto:
  77.       class: Producto
  78.       local: idProducto
  79.       foreign: idProductos
  80.       foreignAlias: DetalleVentas
  81.   indexes:
  82.     idVentas_idx:
  83.       fields: [idVenta]
  84.     idProductos_idx:
  85.       fields: [idProducto]
  86.  
  87. Producto:
  88.   tableName: Productos
  89.   columns:
  90.     idProductos:
  91.       type: integer(4)
  92.       primary: true
  93.       notnull: true
  94.       autoincrement: true
  95.     nombre:
  96.       type: string(45)
  97.       notnull: true
  98.     precio:
  99.       type: decimal(18)
  100.       scale: 2
  101.       notnull: true