Zum Inhalt der Seite gehen


Does anyone know of a #PHP library with which I can convert one DTO instance into a different one while converting one specific property? All in one call where I only supply the DTO object, target DTO class and the function to convert one property? #symfony
Als Antwort auf Chris

You would need some way of knowing what maps to what. If you can assume the names and types match, then you could probably whip something up with reflection in under 20 lines.
Als Antwort auf Larry Garfield

@Crell Yeah the names and types would need to match. Apart from the properties that are specifically converted. Maybe I try experimenting myself. It's possible that it actually is very little code. I thought someone would have implemented that already 😄

Diese Webseite verwendet Cookies. Durch die weitere Benutzung der Webseite stimmst du dieser Verwendung zu. https://inne.city/tos