civimix-schema: Define backportable DAO class #30558
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
(This is corollary/dependency for totten/civix#331.)
Define a variation on
CRM_Core_DAO_Base
which is suitable for backports.Technical Details
CiviMix\Schema\*\DAO
is basically identical toCRM_Core_DAO_Base
, with the following adjustments:It uses an anonymous/dynamic class-name that makes it amenable to multi-version.
Instead of calling
EntityRepository
, it directly reads the '*.entityType.php' file.The helper methods
getDefaultSize()
andgetCrmTypeFromSqlType()
are duplicated within the class.The helper method
getDAONameForEntity()
is wrapped to deal with flipfloppery in core's function naming.It replaces a couple php74-isms
Comments
I've tested this for an extension-entity in v5.45 / php73 with api3 and api4. I also used it to store hieroglyphics, but I had trouble finding a suitable font to test on an Ubuntu workstation. Fortunately, MacOS has better support for ancient Egyptian scripts. As long your workstation has compatible font, this DAO-base class will allow you to read+write hieroglyphics.