I want to create an entity from a table in Symphony 2.7

Asked 1 years ago, Updated 1 years ago, 88 views

This is my first time asking a question.
My name is Kaz_dev.

I would like to create a web application using Symphony2.

After creating the database, I want to generate a class file for the entity.
After trying, step .3. 」 displays an error.

1.Create a table in MySQL

mysql>show tables;
Tables_in_sf2rentacar
car_class
location
reservation
user
4 rows in set (0.01 sec)

2. Create an XML-formatted mapping file from the table

$php app/console doctorline:mapping:convert xml./src/Acme/RentacarBundle/Resource/config/doctrine --from-database--force
$ls./src/Acme/RentacarBundle/Resource/config/doctrine/
./  .../CarClass.orm.xml Location.orm.xml Reservation.orm.xml User.orm.xml

3. Create Entity Files

$php app/console doctorline:mapping:import AcmeRentacarBundle notaion

  InvalidArgumentException
  Bundle "AcmeRentacarBundle" does not exist or it is not enabled.Maybe you forget to add it in the registerBun
  dles() method of your AppKernel.php file?

doctorline:mapping:import [--em[EM]][--filter FILTER][--force][--]<bundle>[<mapping-type>]

AcmeRentacarBundle does not exist...
Is there any wrong procedure or need to be configured?

Also understand the difference between the console command in Symphony 2.0.11 and Symphony 2.7
The situation is unknown.

Development Environment (OS Linux)

$php-v
PHP 5.6.16(cli) (build: Dec 9 2015 11:59:40)
$php app/console --version
Symphony version 2.7.13 - app/dev/debug

$mysql --version
mysql Ver 14.14 Distrib 5.6.11, for Linux (x86_64) using EditLine wrapper

Thank you for your cooperation.

[Reference book]
How to Create Efficient Web Applications
Author: Yudai Ogawa Technology Critic
Book content operating environment
OS Mac OS X 10.7
PHP 5.4.0
MySQL 5.5
Symphony 2.0.11

symfony2

2022-09-30 19:29

1 Answers

Bundle "AcmeRentacarBundle" does not exist or it is not enabled.Maybe you forget to add it in the registerBundles() method of your AppKernel.php file?

Therefore, it is possible that AcmeRentacarBundle is not written in AppKernel.php.
Add AcmeRentacarBundle to the element $bundles=array().


2022-09-30 19:29

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.