при создании Entity Doctrine в Symfony 2
c помощью командной строки
c:OpenServerdomainsmysite>....modulesphpPHP-5.4.13php.exe appconsole
doctrine:generate:entity
появляется ошибка Warning: date_default_timezone_get(): It is not safe to rely on the system t imezone settings.
Warning: date_default_timezone_get(): It is not safe to rely on the system's t
imezone settings. You are *required* to use the date.timezone setting or the dat
e_default_timezone_set() function. In case you used any of those methods and you
are still getting this warning, you most likely misspelled the timezone identif
ier. We selected the timezone 'UTC' for now, but please set date.timezone to sel
ect your timezone. in C:Serverdomainsmysitevendormonologmonologsrc
MonologLogger.php line 111
C:OpenServerdomainsmysitevendormonologmonologsrc
MonologLogger.php line 112
или измените конфиг php.ini установите time zone
date.timezone='Europe/Moscow'
или добавите в файл Logger.php
date_default_timezone_set('Europe/Moscow');
спасибо, вроде помогло
можете рассказать последовательность действий для создания сущности в доктрине
запустите из командной строки
c:OpenServerdomainsmysite>....modulesphpPHP-5.4.13php.exe appconsole
doctrine:generate:entity
Welcome to the Doctrine2 entity generator
This command helps you generate Doctrine2 entities.
First, you need to give the entity name you want to generate.
You must use the shortcut notation like AcmeBlogBundle:Post.
Затем доктрина попросит ввести имена и типы полей- для них будут автоматически созданы приватные свойства и методы для изменения или выбора значений
The Entity shortcut name:
The entity name must contain a : ("" given, expecting something like AcmeBlogBu
ndle:Blog/Post)
The Entity shortcut name:
AcmeUserBundle:MYEntityName
Determine the format to use for the mapping information.
Configuration format (yml, xml, php, or annotation) [annotation]:
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,
timestamp, date, time, decimal, float, blob, guid.
New field name (press
to stop adding fields): id
Field "id" is already defined.
New field name (press to stop adding fields): field2
Field type [string]: text
New field name (press to stop adding fields): field3
Field type [string]: text
New field name (press to stop adding fields):
Do you want to generate an empty repository class [no]? yes
Summary before generation
You are going to generate a "AcmeUserBundle:MYEntityName" Doctrine2 entity
using the "annotation" format.
Do you confirm generation [yes]? yes
Entity generation
Generating the entity code: OK
You can now start using the generated code!
потом зайдите в сформированный файл, проверьте namespases use
заполните какую таблицу в базе данных отражает сущность
- для этого напишите имя таблицы....
Комментарии
Оставить комментарий
Выполнение скриптов на стороне сервера PHP (LAMP) NodeJS (Backend)
Термины: Выполнение скриптов на стороне сервера PHP (LAMP) NodeJS (Backend)