sql >> Database teknologi >  >> RDS >> Mysql

Symfony 3.4 Ingen metadataklasser at behandle Fejl

Ja, endelig fandt jeg ud af, at problemet er med John.orm.php fil, som genereres, når jeg kørte php bin/console doctrine:generate:entity

Jeg har oprettet Entity class ved at bruge følgende kommando

php bin/console doctrine:generate:entity

Derefter bliver du bedt om at

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: AppBundle:John

Determine the format to use for the mapping information.

Configuration format (yml, xml, php, or annotation) [annotation]: php

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): id
 Field "id" is already defined.
New field name (press <return> to stop adding fields): username
Field type [string]: string
Field length [255]:
Is nullable [false]: true
Unique [false]: false

New field name (press <return> to stop adding fields): password
Field type [string]:
Field length [255]:
Is nullable [false]: true
Unique [false]:

New field name (press <return> to stop adding fields): dob
Field type [string]: date
Is nullable [false]: true
Unique [false]:

New field name (press <return> to stop adding fields):


  Entity generation


  created .\src\AppBundle/Entity/John.php
  created .\src\AppBundle/Resources/config/doctrine/
  created .\src\AppBundle/Resources/config/doctrine/John.orm.php
> Generating entity class G:\XAMPP\htdocs\project\src\AppBundle\Entity\John.php:
 OK!
> Generating repository class G:\XAMPP\htdocs\project\src\AppBundle\Repository\J
ohnRepository.php: OK!
> Generating mapping file G:\XAMPP\htdocs\project\src\AppBundle\Resources\config
\doctrine\John.orm.php: OK!


  Everything is OK! Now get to work :).



G:\XAMPP\htdocs\project>

Og efter succes vil den oprette entitetsklasse i AppBundle\Entity; mappe og lagerklasse i AppBundle\Repository; det vil også generere John.orm.php i AppBundle\Resources\config\doctrine\John.orm.php

Efter at have slettet John.orm.php-filen, hvis jeg kører php bin/console doctrine:schema:update --force så vil den generere tabeller.



  1. Sådan angives en fane i en postgres frontend COPY

  2. LINQ til Entities multiple join

  3. Sqlite eller MySql? Hvordan beslutter man sig?

  4. Django Fremmednøgle i et andet skema