DoctrineExtensions
DoctrineExtensions copied to clipboard
Fatal error: Uncaught Doctrine\Common\Annotations\AnnotationException
Fatal error: Uncaught Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@Gedmo\Mapping\Annotation\SoftDeleteable" in class Models\Brand was never imported. Did you maybe forget to add a "use" statement for this annotation? in /var/www/html/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php on line 39
<?php
namespace Models;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation AS Gedmo;
use Doctrine\Common\Collections\ArrayCollection;
use Models\Model;
/**
* @ORM\Entity
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
* @ORM\HasLifecycleCallbacks
* @ORM\Table(name="brands")
*/
class Brand extends BaseModel
{
Composer (Composer version 2.0-dev):
"require": {
"php": "7.3.*",
"ext-curl": "*",
"ext-json": "*",
"vlucas/phpdotenv": "2.6.5",
"doctrine/orm": "^2.7",
"fzaninotto/faker": "^1.9",
"gedmo/doctrine-extensions": "^3.0"
},
In your error message, the @gedmo
is lowercase. Is that the actual error message? PHP is case-sensitive with namespaces and class names.
@JulianaApolo, could you please confirm if you still are experiencing this issue?
I am experiencing it.
namespace Models;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
class Folder {
/**
* @Gedmo\Translatable
* @ORM\Column(name="name", type="string")
*/
private $name;
}
Results in:
[Semantical Error] The annotation "@Gedmo\Mapping\Annotation\Translatable" in property Mode
ls\Folder::$name was never imported. Did you maybe forget to add a "use" statement for this annotation?
This is with ^3.3
. The same thing happen if you explicitly use Gedmo\Mapping\Annotation\Translatable
.
try composer dump-autoload
same issue here
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.