Creating Cartographic Information on an Existing Database Using Doctrine 2

I have Doctrine 2 configured on Zend Framework 1.10, and all startup settings are configured correctly, including all necessary configuration settings in application.ini. Now I need to (or, I suppose) create Entity classes with mapping information so that the entity manager can work with my database.

What I do not want to do is write the Entity classes manually, as this will take a lot of time, but I cannot figure out what to do next. Does the command line tool have functionality for creating entities, proxies, and all other necessary classes from an existing schema?

+3
source share
2 answers

:

 ./bin/doctrine orm:convert-mapping --from-database xml ./bin/tmp

xml. , Doctrine CLI XmlDriver

$driver = new \Doctrine\ORM\Mapping\Driver\XmlDriver(array(
    APPLICATION_PATH . '/../bin/tmp'             
));
$config->setMetadataDriverImpl($driver);

CLI Zend_Application, Bootstrap.

./bin/doctrine orm:generate-entities ./bin/tmp

Xml orm:generate-entities xml . , , .

+3

Source: https://habr.com/ru/post/1788835/


All Articles