Not to be too rude, but this looks like a bunch of 2010-style procedural PHP string concatenation spaghetti. Data mappers and ORMs are pretty much a solved problem. Why write your own as part of your platform? If you’re writing this much boilerplate to reimplement solved problems, it’s no wonder you’re able to get a lot of help from an LLM.