79580684

Date: 2025-04-18 08:38:10
Score: 1.5
Natty:
Report link

@NicoHaase the problem is not in EasyAdmin, but in my limited knowledge) added working code:

/*some code*/

use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\HasLifecycleCallbacks;
use Doctrine\ORM\Mapping\PrePersist;
use Doctrine\ORM\Mapping\PreUpdate;

#[ORM\Entity(repositoryClass: ArticlesTagsRepository::class)]
#[HasLifecycleCallbacks]
class ArticlesTags 
{
  /*some code*/

  #[ORM\PrePersist]
    public function setDateCreateValue(): void
    {
      $this->DATE_CREATE = new \DateTime();
      $this->setDateUpdateValue();
    }

    #[ORM\PreUpdate]
    public function setDateUpdateValue(): void
    {
      $this->DATE_UPDATE = new \DateTime();
    }
}

and it's worked! Thank's for info

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @NicoHaase
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Necro The Human