What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi, i’ve a question. We’re looking for handling persistence actions in repository and entitymanager

UMVPEEVH8
UMVPEEVH8 Posts: 6 🧑🏻‍🚀 - Cadet

Hi, i’ve a question. We’re looking for handling persistence actions in repository and entitymanager and i see that in spryker core it’s working with the transfer-objects and not with entitytransfer-objects. Is there any reason for that? And if that’s correct to work with transfers and not with entitytransfers in repository and entitymanager, what’s the reason to have entitytransfer objects?

Comments

  • entitytransfers should not leave the persistence layer

  • they leak persistence specific content otherwise

  • i think @UK9N7MP96 can shed more light on the reason why they exist in the first place, right?

  • profuel
    profuel SSA Sprykee Posts: 82 🪐 - Explorer

    Shortly:
    Non Persistence layer - Transfer objects
    Persistence Layer:
    input: Transfer objects
    internally Transfer + EntityTransfer (preferably no Propel objects)
    output: Transfer objects

    In case if performance requirements (like import) you're free to use Propel objects directly, but keep those as more localized as possible.

  • Unknown
    edited November 2019

    i would still like to get a refresher about the entitytransfers’ raison d’être 🙂

  • We would recommend to operate with transfer and propel entity in Repository and EntityManager. And do not recommend use propel entities outside those models.

  • UMVPEEVH8
    UMVPEEVH8 Posts: 6 🧑🏻‍🚀 - Cadet

    Ok, that helps a lot i think, thank you. I thought that the EntityTransfer objects exist to communicate with the persistence layer and not only for internal communication in the layer.

  • you will, however, see entity transfers being used to set up fixture data in somoe of the tests