symfony 3 Пример генерации сущности Entity в консоли -- doctrine:generate:entity (основа для модели)
Primary tabs
Начиная с версии Symfony 4.0 делается так.
Для Symfony 3.4 и меньше:
В ответ на команду:
php bin/console doctrine:generate:entity
делаем так:
The Entity shortcut name: AppBundle:Image Determine the format to use for the mapping information. Configuration format (yml, xml, php, or annotation) [annotation]: yml Instead of starting with a blank entity, you can add some fields now. Note that the primary key will be added automatically (named id). Available types: array, simple_array, json_array, object, boolean, integer, smallint, bigint, string, text, datetime, datetimetz, date, time, decimal, float, binary, blob, guid. New field name (press <return> to stop adding fields): title Field type [string]: Field length [255]: Is nullable [false]: Unique [false]: New field name (press <return> to stop adding fields): description Field type [string]: Field length [255]: 3000 Is nullable [false]: Unique [false]: New field name (press <return> to stop adding fields):
то есть "путь" к сущности надо указывать относительно папки Entity бандла -- например, если в корне аппБандла так так:
AppBundle:Имя
- Log in to post comments
- 2937 reads