* @copyright CiviCRM LLC https://civicrm.org/licensing
*/
+use Civi\Api4\Utils\ReflectionUtils;
+
/**
* Base class for admin forms.
*/
if (isset($this->_id) && CRM_Utils_Rule::positiveInteger($this->_id)) {
if ($this->retrieveMethod === 'retrieve') {
$params = ['id' => $this->_id];
- $this->_BAOName::retrieve($params, $this->_values);
+ if (!empty(ReflectionUtils::getCodeDocs((new \ReflectionMethod($this->_BAOName, 'retrieve')), 'Method')['deprecated'])) {
+ CRM_Core_DAO::commonRetrieve($this->_BAOName, $params, $this->_values);
+ }
+ else {
+ // Are there still some out there?
+ $this->_BAOName::retrieve($params, $this->_values);
+ }
}
elseif ($this->retrieveMethod === 'api4') {
$this->_values = civicrm_api4($this->getDefaultEntity(), 'get', [