Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [Symfony]2 błąd przy generowaniu entities relacji manyToMany
duga
post 22.09.2011, 15:10:52
Post #1





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 28.07.2011

Ostrzeżenie: (0%)
-----


Tworzę sobie prosty blog w symfony2 dla przećwiczenia wiedzy (lub niewiedzy), przebrnąłem przez kontrolery i szablony, teraz doszedłem do doctrine. Zrobiłem sobie takie tabelki w yml:


article table

Kod
tpsa\StoreBundle\Entity\article:
  type: entity
  table: null
  fields:
    id:
      type: integer
      id: true
      generator:
        strategy: AUTO
    description:
      type: string
      length: '255'
    content:
      type: text
      length: '65535'
    created_at:
      type: datetime
      length: null
    updated_at:
      type: datetime
      length: null
  manyToOne:
    author:
      targetEntity: user
      joinColumn:
        name: user_id
        referencedColumnName: id
  manyToMany:
    tags:
      targetEnity: tag
      inversedBy: article
      joinTable:
        name: article_tag
        joinColumns:
          article_id:
            referencedColumnName: id
        inversedJoinColumns:
          tag_id:
            referencedColumnName: id

  lifecycleCallbacks: {  }


tag table:

Kod
tpsa\StoreBundle\Entity\tag:
  type: entity
  table: null
  fields:
    id:
      type: integer
      id: true
      generator:
        strategy: AUTO
    name:
      type: string
      length: 255
    created_at:
      type: datetime
    updated_at:
      type: datetime
  manyToMany:
    articles:
      targetEnity: article
      mappedBy: tags

  lifecycleCallbacks: {  }


Przykład ten robiłem wzorując się na dokumentacji ze strony:

[url link="http://www.doctrine-project.org/docs/orm/2.0/en/reference/association-mapping.html"]5. Association Mapping[/url]

Przy generowaniu entities wyskakuje mnie:

Cytat
[ErrorException]
Notice: Undefined index: targetEntity in /var/www/symfony/vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php line 391


Co robie źle?
Go to the top of the page
+Quote Post
Crozin
post 22.09.2011, 15:20:35
Post #2





Grupa: Zarejestrowani
Postów: 6 476
Pomógł: 1306
Dołączył: 6.08.2006
Skąd: Kraków

Ostrzeżenie: (0%)
-----


Znajdź różnice: targetEnity - targetEntity.
Go to the top of the page
+Quote Post
duga
post 22.09.2011, 16:23:36
Post #3





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 28.07.2011

Ostrzeżenie: (0%)
-----


Dzięki, znalazłem jeszcze parę literówek ;-)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 17.06.2025 - 20:09