0

I have the following entity:

<?php

namespace App\Entity\Geo;

use Doctrine\ORM\Mapping as ORM;

/*
 * @ORM\Entity(repositoryClass="App\Repository\Geo\CityRepository")
 * @ORM\Table(name="geo_cities")
 */
class City
{
  /**
   * @ORM\Id()
   * @ORM\GeneratedValue()
   * @ORM\Column(type="integer")
   */
  protected ?int $id = null;

  /**
   * Name of the city
   *
   * @ORM\Column(type="string", length=50, nullable=false)
   */
  protected string $name;

  /**
   * Addition for name of city
   *
   * @ORM\Column(type="string", length=20, nullable=false)
   */
  protected ?string $name_more = null;

  // Setters and getters
}

This entity is considered as invalid in Symfony console.

When I execute php bin/console doctrine:mapping:info, it is not listed.

I tried to rename entity, the namespace, remove fields, add fields but in all cases, the entity is not valid.

Any idea ?

Note: I have another entity with same structure and it is valid for doctrine.

1 Answer 1

2

It's missing one * here

/*
 * @ORM\Entity(repositoryClass="App\Repository\Geo\CityRepository")
 * @ORM\Table(name="geo_cities")
 */
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.