Git Product home page Git Product logo

Comments (3)

mbabker avatar mbabker commented on July 3, 2024

There is a test case for the mapped superclass scenario your setup describes.

Adding dd($this->softDeleteableListener->getConfiguration($this->em, self::MAPPED_SUPERCLASS_CHILD_CLASS)); to the start of that test case shows what looks to be the right configuration for that entity:

array:5 [
  "softDeleteable" => true
  "fieldName" => "deletedAt"
  "timeAware" => false
  "hardDelete" => true
  "useObjectClass" => "Gedmo\Tests\SoftDeleteable\Fixture\Entity\Child"
]

I also went ahead and added the TimestampableEntity trait to the mapped superclass and the TimestampableListener to that test case and dumping the entire static config reference in the subscriber's getConfiguration() method gives me this:

array:2 [
  "SoftDeleteable" => array:9 [
    [snip]
    "Gedmo\Tests\SoftDeleteable\Fixture\Entity\Child" => array:5 [
      "softDeleteable" => true
      "fieldName" => "deletedAt"
      "timeAware" => false
      "hardDelete" => true
      "useObjectClass" => "Gedmo\Tests\SoftDeleteable\Fixture\Entity\Child"
    ]
    [snip]
  ]
  "Timestampable" => array:1 [
    "Gedmo\Tests\SoftDeleteable\Fixture\Entity\Child" => array:3 [
      "create" => array:1 [
        0 => "createdAt"
      ]
      "update" => array:1 [
        0 => "updatedAt"
      ]
      "useObjectClass" => "Gedmo\Tests\SoftDeleteable\Fixture\Entity\Child"
    ]
  ]
]

So, the config does appear to be loaded in properly.

from doctrineextensions.

nacesprin avatar nacesprin commented on July 3, 2024

OKay @mbabker . Excuse me, but I have not clearly how do I must to continue.
What do you need exactly from my side? Do you need I execute the test case and write down here the result of the dd() function?

from doctrineextensions.

Chris53897 avatar Chris53897 commented on July 3, 2024

@nacesprin
in your example you wrote. #MappedSuperclass
Is it a correct PHP Attribute or just a comment?

The Entity Mapping is missing in doctrine.yaml .
I use the StofDoctrineExtensionsBundle so i am not sure for your case.

      # StofDoctrineExtensionsBundle (https://symfony.com/doc/current/bundles/StofDoctrineExtensionsBundle/configuration.html#add-the-extensions-to-your-mapping)
      gedmo_loggable:
        type: attribute
        prefix: Gedmo\Loggable\Entity
        dir: "%kernel.project_dir%/vendor/gedmo/doctrine-extensions/src/Loggable/Entity"
        alias: GedmoLoggable # (optional) it will default to the name set for the mapping
        is_bundle: false

from doctrineextensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.