Ver Mensaje Individual
  #4 (permalink)  
Antiguo 28/04/2013, 13:02
Avatar de SirDuque
SirDuque
 
Fecha de Ingreso: febrero-2009
Ubicación: Paso del Rey, Buenos Aires, Argentina
Mensajes: 975
Antigüedad: 15 años, 2 meses
Puntos: 89
Respuesta: [Desarrollo Web Agil Symfony2] Doctrine crea solo tabla Ciudad

En AppKernel.php esta:

Código PHP:
<?php

use SymfonyComponentHttpKernelKernel;
use 
SymfonyComponentConfigLoaderLoaderInterface;

class 
AppKernel extends Kernel
{
    public function 
registerBundles()
    {
        
$bundles = array(
            new 
SistemaCiudadBundleCiudadBundle(),
            new 
SistemaVehiculoBundleVehiculoBundle(),
Este es el codigo de Ciudad, el cual si funciona perfecto, con generate:entity y todo:
Código:
$ ll src/Sistema/CiudadBundle/Entity/Ciudad.php 
-rw-r--r-- 1 mge www-data 3438 abr 28 15:13 src/Sistema/CiudadBundle/Entity/Ciudad.php
Código PHP:
Ver original
  1. <?php
  2.  
  3. namespace Sistema\CiudadBundle\Entity;
  4.  
  5. use Doctrine\ORM\Mapping as ORM;
  6.  
  7. /**
  8.  * @ORM\Entity
  9.  * @ORM\Table(name="ch_ciudad")
  10.  */
  11. class Ciudad
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\Column(type="integer")
  16.      * @ORM\GeneratedValue
  17.      */
  18.     protected $id;
  19.     /** @ORM\Column(type="string", length=50, unique=true)*/
  20.     protected $nombre;
  21.     /** @ORM\Column(type="string", length=55, unique=true)*/
  22.     protected $slug;
  23.     /** @ORM\Column(type="string", length=12)*/
  24.     protected $codigoPostal;
  25.     /** @ORM\Column(type="integer")*/
  26.     protected $codigoArea;
  27.     /** @ORM\Column(type="datetime")*/
  28.     protected $alta;
  29.     /** @ORM\Column(type="datetime")*/
  30.     protected $baja;
  31.     /** @ORM\Column(type="boolean")*/
  32.     protected $activo;
  33.  
  34.     /**
  35.      * Get id
  36.      *
  37.      * @return integer
  38.      */
  39.     public function getId()
  40.     {
  41.         return $this->id;
  42.     }
  43.  
  44.     /**
  45.      * Set nombre
  46.      *
  47.      * @param string $nombre
  48.      * @return Ciudad
  49.      */
  50.     public function setNombre($nombre)
  51.     {
  52.         $this->nombre = $nombre;
  53.    
  54.         return $this;
  55.     }
  56.  
  57.     /**
  58.      * Get nombre
  59.      *
  60.      * @return string
  61.      */
  62.     public function getNombre()
  63.     {
  64.         return $this->nombre;
  65.     }
  66.  
  67.     /**
  68.      * Set slug
  69.      *
  70.      * @param string $slug
  71.      * @return Ciudad
  72.      */
  73.     public function setSlug($slug)
  74.     {
  75.         $this->slug = $slug;
  76.    
  77.         return $this;
  78.     }
  79.  
  80.     /**
  81.      * Get slug
  82.      *
  83.      * @return string
  84.      */
  85.     public function getSlug()
  86.     {
  87.         return $this->slug;
  88.     }
  89.  
  90.     /**
  91.      * Set codigoPostal
  92.      *
  93.      * @param string $codigoPostal
  94.      * @return Ciudad
  95.      */
  96.     public function setCodigoPostal($codigoPostal)
  97.     {
  98.         $this->codigoPostal = $codigoPostal;
  99.    
  100.         return $this;
  101.     }
  102.  
  103.     /**
  104.      * Get codigoPostal
  105.      *
  106.      * @return string
  107.      */
  108.     public function getCodigoPostal()
  109.     {
  110.         return $this->codigoPostal;
  111.     }
  112.  
  113.     /**
  114.      * Set codigoArea
  115.      *
  116.      * @param integer $codigoArea
  117.      * @return Ciudad
  118.      */
  119.     public function setCodigoArea($codigoArea)
  120.     {
  121.         $this->codigoArea = $codigoArea;
  122.    
  123.         return $this;
  124.     }
  125.  
  126.     /**
  127.      * Get codigoArea
  128.      *
  129.      * @return integer
  130.      */
  131.     public function getCodigoArea()
  132.     {
  133.         return $this->codigoArea;
  134.     }
  135.  
  136.     /**
  137.      * Set alta
  138.      *
  139.      * @param \datetime $alta
  140.      * @return Ciudad
  141.      */
  142.     public function setAlta($alta)
  143.     {
  144.         $this->alta = $alta;
  145.    
  146.         return $this;
  147.     }
  148.  
  149.     /**
  150.      * Get alta
  151.      *
  152.      * @return \datetime
  153.      */
  154.     public function getAlta()
  155.     {
  156.         return $this->alta;
  157.     }
  158.  
  159.     /**
  160.      * Set baja
  161.      *
  162.      * @param \datetime $baja
  163.      * @return Ciudad
  164.      */
  165.     public function setBaja($baja)
  166.     {
  167.         $this->baja = $baja;
  168.    
  169.         return $this;
  170.     }
  171.  
  172.     /**
  173.      * Get baja
  174.      *
  175.      * @return \datetime
  176.      */
  177.     public function getBaja()
  178.     {
  179.         return $this->baja;
  180.     }
  181.  
  182.     /**
  183.      * Set activo
  184.      *
  185.      * @param boolean $activo
  186.      * @return Ciudad
  187.      */
  188.     public function setActivo($activo)
  189.     {
  190.         $this->activo = $activo;
  191.    
  192.         return $this;
  193.     }
  194.  
  195.     /**
  196.      * Get activo
  197.      *
  198.      * @return boolean
  199.      */
  200.     public function getActivo()
  201.     {
  202.         return $this->activo;
  203.     }
  204.  
  205.     /**
  206.      * echo Class
  207.      * @return string Nombre
  208.      */
  209.     public function __toString()
  210.     {
  211.         return $this->getNombre();
  212.     }
  213. }
__________________
Mono programando!
twitter.com/eguimariano