Re: Re: [RFC] Deprecate dynamic properties

From: Date: Mon, 15 Nov 2021 20:39:59 +0000
Subject: Re: Re: [RFC] Deprecate dynamic properties
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-116392@lists.php.net to get a copy of this message
On Mon, Nov 15, 2021 at 3:11 PM Deleu <deleugyn@gmail.com> wrote: > By design my REST API utilizes dynamic properties. I've always found it to >> be a feature of PHP, not a bug. >> >> -- >> Chase Peeler >> chasepeeler@gmail.com >> > > I am in the unfortunate position of inheriting a system with such REST API > design. I can never build new REST APIs to replace the old ones because > nobody can ever know how many combinations of possible input parameters > there are. > > Our inputs and outputs are both well defined. I've built a framework around our entities that convert them into API payloads - attributes (symfony, but eventually we might update it to use native attributes) define what fields are visible based on user and whether it's the short (e.g. part of a collection) or full version. The thing is that occasionally we'll have a payload to return that requires additional attributes. Dynamic properties allow us to just tack that on to the existing entity without having to define it as a property on the entity (outside of the one use case the property isn't needed and it definitely doesn't correspond to a database column). > -- > Marco Aurélio Deleu > -- Chase Peeler chasepeeler@gmail.com

« previous php.internals (#116392) next »