Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [symfony][propel] Problem z "pustą" klasą
qqrq
post
Post #1





Grupa: Zarejestrowani
Postów: 418
Pomógł: 8
Dołączył: 16.11.2006

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


Witam

Znów mam kłopot, tym razem z modelem danych w Symfony. Wklepuję w linii komend "symfony propel-build-model", ciach ciach, wszystko ładnie się buduje i chodzi, do czasu, gdy chcę skorzystać z Klasy TabelaPeer, wyskakuje mi błąd:

Kod
Parse error: syntax error, unexpected ')', expecting T_STRING or T_VARIABLE or '$' in .....\lib\model\om\BasePeer.php on line 433


Błąd ten pojawia się dlatego, że w rzeczony pliku w rzeczonej linii mamy taki wpis:

  1. <?php
  2. elseif ($values instanceof )
  3. ?>


Poza tym propel generuje mi plik "lib/model/.php" (w nim klasę "bez nazwy") i "lib/model/om/Base.php" - to chyba z tym jest związane. Używam w mojej bazie danych internalizacji. W "schema.yml" nie mam żadnej pustej linii. Może coś mam źle skonfigurowane?

Ten post edytował qqrq 28.01.2008, 10:44:44


--------------------
Go to the top of the page
+Quote Post
arecki
post
Post #2





Grupa: Zarejestrowani
Postów: 222
Pomógł: 35
Dołączył: 6.02.2005

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


Pokaż 'schema.yml' i sprawdź czy nie masz gdzieś zamiast spacji użytego tabulatora.


--------------------
Go to the top of the page
+Quote Post
qqrq
post
Post #3





Grupa: Zarejestrowani
Postów: 418
Pomógł: 8
Dołączył: 16.11.2006

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


A proszę:

Kod
propel:
data:
  _attributes: { phpName: Data }
  id:
  key: varchar(6)
data_i18n:
  id: { type: integer, required: true, primaryKey: true, foreignTable: data, foreignReference: id }
  culture: { isCulture: true, type: varchar, size: 7, required: true, primaryKey: true }
  value: longvarchar
user:
  _attributes: { phpName: User }
  id:
  login: varchar(20)
  password: varchar(32)
user_i18n:
  id: { type: integer, required: true, primaryKey: true, foreignTable: user, foreignReference: id }
  culture: { isCulture: true, type: varchar, size: 7, required: true, primaryKey: true }
  display: varchar(30)
profile:
  _attributes: { phpName: Profile }
  id:
  name: varchar(60)
  image: varchar(30)
  join_date: date
  left_date: date
  sort: { type: integer, default: 0 }
profile_i18n:
  id: { type: integer, required: true, primaryKey: true, foreignTable: profile, foreignReference: id }
  culture: { isCulture: true, type: varchar, size: 7, required: true, primaryKey: true }
  function: varchar(60)
  description: longvarchar
news:
  _attributes: { phpName: News }
  id:
  image: varchar(30)
  user_id: { type: integer, foreignTable: user, foreignReference: id }
  created_at:
news_i18n:
  id: { type: integer, required: true, primaryKey: true, foreignTable: news, foreignReference: id }
  culture: { isCulture: true, type: varchar, size: 7, required: true, primaryKey: true }
  title: varchar(255)
  content: longvarchar  
album:
  _attributes: { phpName: Album }
  id:
  title: varchar(255)
  image: varchar(30)
  release_date: date
  buy: { type: tinyint, default: 0 }
  sort: { type: integer, default: 0 }
song:
  _attributes: { phpName: Song }
  id:
  title: varchar(255)
  lyrics: longvarchar
  file: varchar(30)
  sort: { type: integer, default: 0 }
  album_id: { type: integer, foreignTable: album, foreignReference: id }
gallery:
  _attributes: { phpName: Gallery }
  id:
  image: varchar(30)
  place: varchar(255)
  photographers: varchar(255)
  date: date
gallery_i18n
  id: { type: integer, required: true, primaryKey: true, foreignTable: gallery, foreignReference: id }
  culture: { isCulture: true, type: varchar, size: 7, required: true, primaryKey: true }
  title: varchar(255)
photo:
  _attributes: { phpName: Photo }
  id:
  file: varchar(30)
  gallery_id: { type: integer, foreignTable: gallery, foreignReference: id }
  created_at:
photo_i18n:
  id: { type: integer, required: true, primaryKey: true, foreignTable: photo, foreignReference: id }
  culture: { isCulture: true, type: varchar, size: 7, required: true, primaryKey: true }
  title: varchar(255)
gigs:
  _attributes: { phpName: Gigs }
  id:
  place: varchar(255)
  with: varchar(255)
  date: date
gigs_i18n:
  id: { type: integer, required: true, primaryKey: true, foreignTable: gigs, foreignReference: id }
  culture: { isCulture: true, type: varchar, size: 7, required: true, primaryKey: true }
  description: longvarchar
links:
  _attributes: { phpName: Links }
  id:
  link: varchar(255)
  sort: { type: integer, default: 0 }
links_i18n:
  id: { type: integer, required: true, primaryKey: true, foreignTable: links, foreignReference: id }
  culture: { isCulture: true, type: varchar, size: 7, required: true, primaryKey: true }
  text: varchar(255)
media_group:
  _attributes: { phpName: MediaGroup }
  id:
  sort: { type: integer, default: 0 }
media_group_i18n:
  id: { type: integer, required: true, primaryKey: true, foreignTable: media_group, foreignReference: id }
  culture: { isCulture: true, type: varchar, size: 7, required: true, primaryKey: true }
  title: varchar(255)
media:
  _attributes: { phpName: Media }
  id:
  file: varchar(30)
  sort: { type: integer, default: 0 }
  media_group_id: { type: integer, foreignTable: media_group, foreignReference: id }
media_i18n:
  id: { type: integer, required: true, primaryKey: true, foreignTable: media, foreignReference: id }
  culture: { isCulture: true, type: varchar, size: 7, required: true, primaryKey: true }
  title: varchar(255)
guestbook:
  _attributes: { phpName: Guestbook }
  id:
  nick: varchar(60)
  content: longvarchar
  created_at:
shop:
  _attributes: { phpName: Shop }
  id:
  image: varchar(30)
  count: { type: integer, default: 0 }
  created_at:
shop_i18n:
  _attributes: { phpName: ShopI18n }
  id: { type: integer, required: true, primaryKey: true, foreignTable: shop, foreignReference: id }
  culture: { isCulture: true, type: varchar, size: 7, required: true, primaryKey: true }
  name: varchar(255)
  description: longvarchar
  price: float
newsletter:
  _attributes: { phpName: Newsletter }
  id:
  email: varchar(60)
  type: varchar(1)
  language: varchar(2)


Tabów nigdzie nie ma.


EDIT: Hi, już znalazłem. smile.gif "gallery_i18n" bez dwukropka. Cipa ze mnie i tyle.

Ten post edytował qqrq 28.01.2008, 11:08:13


--------------------
Go to the top of the page
+Quote Post
arecki
post
Post #4





Grupa: Zarejestrowani
Postów: 222
Pomógł: 35
Dołączył: 6.02.2005

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


Cytat(qqrq @ 28.01.2008, 11:02:12 ) *
EDIT: Hi, już znalazłem. smile.gif "gallery_i18n" bez dwukropka. Cipa ze mnie i tyle.


smile.gif No widzisz... najprostsze rozwiązania są zawsze najtrudniejsze do znalezienia. A swoją drogą to dość ładnie Siebie określiłeś. Ja do swojej osoby używam gorszych wulgaryzmów smile.gif


--------------------
Go to the top of the page
+Quote Post
mike
post
Post #5





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

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


~qqrq skoro Ty ten plik generowałeś to skąd tam takie błędy ?
Go to the top of the page
+Quote Post
arecki
post
Post #6





Grupa: Zarejestrowani
Postów: 222
Pomógł: 35
Dołączył: 6.02.2005

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


Pewnie dlatego że generował klasy z plików YML a te pisał ręcznie. Oj każdy ma prawo się mylić smile.gif


--------------------
Go to the top of the page
+Quote Post
mike
post
Post #7





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

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


Moim zdaniem najwygodniej generować pliki z istniejącej bazy. Pomyłka nie jest możliwa.
Poza tym łatwiej zaprojektować wszystko w bazie a później przenieść to do aplikacji.
Go to the top of the page
+Quote Post
arecki
post
Post #8





Grupa: Zarejestrowani
Postów: 222
Pomógł: 35
Dołączył: 6.02.2005

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


I ja się w pełni zgadzam ale jak powszechnie wiadomo "człowiek uczy się na błędach" a w dodatku tylko i wyłącznie na własnych happy.gif

Ten post edytował arecki 28.01.2008, 20:49:34


--------------------
Go to the top of the page
+Quote Post
qqrq
post
Post #9





Grupa: Zarejestrowani
Postów: 418
Pomógł: 8
Dołączył: 16.11.2006

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


Macie rację, miśki, ale ja, zaczynający wtedy z SYmfony, chciałem sprawdzić jak się projektuję bazę na YML-u. A źle się projektuje. smile.gif


--------------------
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 Aktualny czas: 21.08.2025 - 15:17