Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Inheritance Mapping in other database doesn't works #69

Open
JonathanRamier opened this issue Mar 13, 2015 · 3 comments
Open

Inheritance Mapping in other database doesn't works #69

JonathanRamier opened this issue Mar 13, 2015 · 3 comments

Comments

@JonathanRamier
Copy link

Hi,

I try to use you bundle, however I 've a problem when I implement a the bundle with a new database. My configuration looks like this

-- my jns_xhprof.yml

jns_xhprof:
    location_web:    http://profiler.api.me.lan/
    entity_manager:  profiler
    enabled:         true
    entity_class:    Acme\ProfilerBundle\Entity\XhprofDetail
    enable_xhgui:    true
    command: option
    command_option_name: xhprof

In my config.yml,

doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                driver:   "pdo_pgsql"
                host:     "localhost"
                port:     "5432"
                dbname:   "app"
                user:     "user"
                password: "user"
                charset:  UTF8
            profiler:
                driver:   "pdo_pgsql"
                host:     "localhost"
                port:     "5432"
                dbname:   "profiler"
                user:     "profiler"
                password: "profiler"
                charset:  UTF8

    orm:
        default_entity_manager: default
        auto_generate_proxy_classes: "%kernel.debug%"
        entity_managers:
            default:
                connection: default
                mappings:
                    AcmeAppBundle:  ~
            profiler:
                connection: profiler
                mappings:
                    AcmeProfilerBundle:  ~

then I create my entity class like said in readMe

use Jns\Bundle\XhprofBundle\Entity\XhprofDetail as Base;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="details")
 */
class XhprofDetail extends Base
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="string", unique=true, length=17, nullable=false)
     * @ORM\Id
     */
    protected $id;
}

And when I deploy with the symfony command, my 'details' table contains only Id.

php app/console doctrine:schema:update --em=profiler

-- results

           Table "public.details"

 Column |         Type          | Modifiers 
--------+-----------------------+-----------
 id     | character varying(17) | not null

Why My entity doesn't inherit of the MasterMappedClass ? That very strange because when I unset the em=provider in my command, the table was generated correctly. Do I do a bad something ?

Cheers

@stephpy
Copy link
Collaborator

stephpy commented Mar 16, 2015

Hi,

Did you activate the bundle into your dev environment or only in test environment ?

@JonathanRamier
Copy link
Author

Hi,
I want to implement the bundle in a production environment for profiling. I added in Appkernel like this

$bundles = array(
            new Acme\AppBundle\AcmeAppBundle(),

            new Jns\Bundle\XhprofBundle\JnsXhprofBundle(),
            new Acme\ProfilerBundle\AcmeProfilerBundle(),
        );

@stephpy
Copy link
Collaborator

stephpy commented Mar 18, 2015

Did you registered many entityManagers ? Looks something like that ...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants