There is beauty in the simplicity of AQC, but is achieved by putting everything into an undefined params array. Moreover, you then have this set of isset checks that build a query. Also, you assume that to retrieve a product you only need to query one table (in other words that business entity is the same as ORM entity).
From my point of view it looks great until it doesn't ;)
So as long as the params array is described in the DocBlock, and the class is split if a number of conditions becomes unclear, and you only need to query a limited set of tables, this is great.
Remix Developer, Tailwind, Laravel, Full Stack Developer at Ohad Technologies
Available for 1:1 session on topmate.io. Book me here
https://topmate.io/raheelshan/
Location
Karachi, Pakistan
Education
Federal Urdu University of Arts Science and Technology
Yes, the params array should definitely be documented — I agree with you on that. For now, since AQC is still in its initial form, I’ve kept it focused on querying a single table. Later on, we can evolve it further by adding methods for joins and handling related data.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
There is beauty in the simplicity of AQC, but is achieved by putting everything into an undefined
paramsarray. Moreover, you then have this set ofissetchecks that build a query. Also, you assume that to retrieve aproductyou only need to query one table (in other words that business entity is the same as ORM entity).From my point of view it looks great until it doesn't ;)
So as long as the
paramsarray is described in the DocBlock, and the class is split if a number of conditions becomes unclear, and you only need to query a limited set of tables, this is great.Yes, the params array should definitely be documented — I agree with you on that. For now, since AQC is still in its initial form, I’ve kept it focused on querying a single table. Later on, we can evolve it further by adding methods for joins and handling related data.