Proposal pseudoconstant facade
I have long found using the core pseudoconstant functions a bit error prone as I 'guess' the BAO names & mix 'Contribute' & Contribution etc
Perhaps we should add
\Civi::pseudoConstant($entity)->getKey($name, $fieldName);
\Civi::pseudoConstant($entity)->getLabel($id, $fieldName);
\Civi::pseudoConstant($entity)->getName($id, $fieldName);
(e.g value could be 'icon')
\Civi::pseudoConstant($entity)->getValue($id, $fieldName, $value);
I have some misgivings about the work pseudoConstant - it could be '\Civi::options()' or something else
Importantly $entity
is the short-name
- I just added a note to docs discouraging people from randomly using core functions & suggesting they use only ones that are explicitly for external use & realised that there is no explicitly supported version of these super important functions