This function was spawned to every BAO by copy/paste but has limited usefulness.
It should be deprecated in favor of the API & eventually removed.
}
/**
+ * Retrieve DB object and copy to defaults array.
+ *
* @param array $params
+ * Array of criteria values.
* @param array $defaults
+ * Array to be populated with found values.
+ *
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- CRM_Core_DAO::commonRetrieve('CRM_ACL_DAO_ACL', $params, $defaults);
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
}
/**
+ * Retrieve DB object and copy to defaults array.
+ *
* @param array $params
+ * Array of criteria values.
* @param array $defaults
+ * Array to be populated with found values.
+ *
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- CRM_Core_DAO::commonRetrieve(__CLASS__, $params, $defaults);
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
class CRM_Badge_BAO_Layout extends CRM_Core_DAO_PrintLabel {
/**
- * Retrieve DB object based on input parameters.
- *
- * It also stores all the retrieved values in the default array.
+ * Retrieve DB object and copy to defaults array.
*
+ * @deprecated
* @param array $params
- * (reference ) an assoc array of name/value pairs.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
*
- * @return CRM_Core_DAO_PrintLabel|null
- * object on success, null otherwise
+ * @return CRM_Core_DAO_PrintLabel|NULL
*/
- public static function retrieve(&$params, &$defaults) {
- $printLabel = new CRM_Core_DAO_PrintLabel();
- $printLabel->copyValues($params);
- if ($printLabel->find(TRUE)) {
- CRM_Core_DAO::storeValues($printLabel, $defaults);
- return $printLabel;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve('CRM_Core_DAO_PrintLabel', $params, $defaults);
}
/**
}
/**
- * Retrieve DB object based on input parameters.
- *
- * It also stores all the retrieved values in the default array.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return \CRM_Campaign_DAO_Campaign|null
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $campaign = new CRM_Campaign_DAO_Campaign();
-
- $campaign->copyValues($params);
-
- if ($campaign->find(TRUE)) {
- CRM_Core_DAO::storeValues($campaign, $defaults);
- return $campaign;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
class CRM_Campaign_BAO_Survey extends CRM_Campaign_DAO_Survey implements Civi\Test\HookInterface {
/**
- * Retrieve DB object based on input parameters.
- *
- * It also stores all the retrieved values in the default array.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
+ *
+ * @return self|null
+ * The DAO object, if found.
*
- * @return CRM_Campaign_DAO_Survey|null
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $dao = new CRM_Campaign_DAO_Survey();
-
- $dao->copyValues($params);
-
- if ($dao->find(TRUE)) {
- CRM_Core_DAO::storeValues($dao, $defaults);
- return $dao;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
class CRM_Contact_BAO_ContactType extends CRM_Contact_DAO_ContactType implements \Civi\Test\HookInterface {
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Contact_DAO_ContactType|null
- * object on success, null otherwise
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $contactType = new CRM_Contact_DAO_ContactType();
- $contactType->copyValues($params);
- if ($contactType->find(TRUE)) {
- CRM_Core_DAO::storeValues($contactType, $defaults);
- return $contactType;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group {
/**
- * Retrieve DB object based on input parameters.
- *
- * It also stores all the retrieved values in the default array.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
+ *
+ * @return self|null
+ * The DAO object, if found.
*
- * @return CRM_Contact_BAO_Group
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $group = new CRM_Contact_DAO_Group();
- $group->copyValues($params);
- if ($group->find(TRUE)) {
- CRM_Core_DAO::storeValues($group, $defaults);
- return $group;
- }
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
class CRM_Contact_BAO_RelationshipType extends CRM_Contact_DAO_RelationshipType implements \Civi\Test\HookInterface {
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Contact_BAO_RelationshipType
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $relationshipType = new CRM_Contact_DAO_RelationshipType();
- $relationshipType->copyValues($params);
- if ($relationshipType->find(TRUE)) {
- CRM_Core_DAO::storeValues($relationshipType, $defaults);
- return $relationshipType;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch {
/**
- * Retrieve DB object based on input parameters.
- *
- * It also stores all the retrieved values in the default array.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
+ *
+ * @return self|null
+ * The DAO object, if found.
*
- * @return CRM_Contact_DAO_SavedSearch
+ * @deprecated
*/
public static function retrieve($params, &$defaults = []) {
- $savedSearch = new CRM_Contact_DAO_SavedSearch();
- $savedSearch->copyValues($params);
- if ($savedSearch->find(TRUE)) {
- CRM_Core_DAO::storeValues($savedSearch, $defaults);
- return $savedSearch;
- }
- return NULL;
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
}
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
+ *
+ * @return self|null
+ * The DAO object, if found.
*
- * @return CRM_Contribute_BAO_ContributionSoft
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $contributionSoft = new CRM_Contribute_DAO_ContributionSoft();
- $contributionSoft->copyValues($params);
- if ($contributionSoft->find(TRUE)) {
- CRM_Core_DAO::storeValues($contributionSoft, $defaults);
- return $contributionSoft;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
*
* @deprecated
* @param array $params
- * (reference ) an assoc array of name/value pairs.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
*
* @return CRM_Contribute_BAO_Product
*/
private static $productInfo;
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
+ * @deprecated
* @param array $params
- * (reference ) an assoc array of name/value pairs.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
*
- * @return CRM_Contribute_DAO_Product
+ * @return CRM_Contribute_DAO_Product|NULL
*/
- public static function retrieve(&$params, &$defaults) {
- $premium = new CRM_Contribute_DAO_Product();
- $premium->copyValues($params);
- if ($premium->find(TRUE)) {
- CRM_Core_DAO::storeValues($premium, $defaults);
- return $premium;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve('CRM_Contribute_DAO_Product', $params, $defaults);
}
/**
}
/**
- * Retrieve DB object based on input parameters.
- *
- * It also stores all the retrieved values in the default array.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
- * @param array $values
- * (reference ) an assoc array to hold the flattened values.
+ * Array of criteria values.
+ * @param array $defaults
+ * Array to be populated with found values.
+ *
+ * @return self|null
+ * The DAO object, if found.
*
- * @return CRM_Core_DAO_ActionSchedule|null
- * object on success, null otherwise
+ * @deprecated
*/
- public static function retrieve(&$params, &$values) {
+ public static function retrieve($params, &$defaults) {
if (empty($params)) {
return NULL;
}
- $actionSchedule = new CRM_Core_DAO_ActionSchedule();
-
- $actionSchedule->copyValues($params);
-
- if ($actionSchedule->find(TRUE)) {
- CRM_Core_DAO::storeValues($actionSchedule, $values);
- return $actionSchedule;
- }
- return NULL;
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
}
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * An assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Core_DAO_CustomField
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
public static function retrieve($params, &$defaults) {
- return CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomField', $params, $defaults);
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
}
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Core_DAO_CustomGroup
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- return CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomGroup', $params, $defaults);
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
class CRM_Core_BAO_CustomOption {
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
+ * @deprecated
* @param array $params
- * (reference ) an assoc array of name/value pairs.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
*
- * @return CRM_Core_BAO_CustomOption
+ * @return CRM_Core_DAO_OptionValue|NULL
*/
- public static function retrieve(&$params, &$defaults) {
- $customOption = new CRM_Core_DAO_OptionValue();
- $customOption->copyValues($params);
- if ($customOption->find(TRUE)) {
- CRM_Core_DAO::storeValues($customOption, $defaults);
- return $customOption;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_OptionValue', $params, $defaults);
}
/**
}
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Core_DAO_Domain
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- return CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_Domain', $params, $defaults);
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
class CRM_Core_BAO_Extension extends CRM_Core_DAO_Extension {
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Core_BAO_LocationType|null
- * object on success, null otherwise
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $extension = new CRM_Core_DAO_Extension();
- $extension->copyValues($params);
- if ($extension->find(TRUE)) {
- CRM_Core_DAO::storeValues($extension, $defaults);
- return $extension;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
}
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
+ *
+ * @return self|null
+ * The DAO object, if found.
*
- * @return \CRM_Financial_DAO_FinancialTrxn
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults = []) {
- $financialItem = new CRM_Financial_DAO_FinancialTrxn();
- $financialItem->copyValues($params);
- if ($financialItem->find(TRUE)) {
- CRM_Core_DAO::storeValues($financialItem, $defaults);
- return $financialItem;
- }
- return NULL;
+ public static function retrieve($params, &$defaults = []) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
}
/**
- * Retrieve DB object based on input parameters.
- *
- * It also stores all the retrieved values in the default array.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
+ *
+ * @return self|null
+ * The DAO object, if found.
*
- * @return CRM_Core_DAO_Job|null
- * object on success, null otherwise
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $job = new CRM_Core_DAO_Job();
- $job->copyValues($params);
- if ($job->find(TRUE)) {
- CRM_Core_DAO::storeValues($job, $defaults);
- return $job;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
public static $_billingLocationType = NULL;
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Core_DAO_LocationType|null
- * object on success, null otherwise
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $locationType = new CRM_Core_DAO_LocationType();
- $locationType->copyValues($params);
- if ($locationType->find(TRUE)) {
- CRM_Core_DAO::storeValues($locationType, $defaults);
- return $locationType;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
}
/**
- * Retrieve DB object based on input parameters.
- *
- * It also stores all the retrieved values in the default array.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Core_BAO_MailSettings
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $mailSettings = new CRM_Core_DAO_MailSettings();
- $mailSettings->copyValues($params);
-
- $result = NULL;
- if ($mailSettings->find(TRUE)) {
- CRM_Core_DAO::storeValues($mailSettings, $defaults);
- $result = $mailSettings;
- }
-
- return $result;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping implements \Civi\Test\HookInterface {
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return object
- * CRM_Core_DAO_Mapping object on success, otherwise NULL
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $mapping = new CRM_Core_DAO_Mapping();
- $mapping->copyValues($params);
- if ($mapping->find(TRUE)) {
- CRM_Core_DAO::storeValues($mapping, $defaults);
- return $mapping;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate implements \Civi\Test\HookInterface {
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Core_DAO_MessageTemplate
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $messageTemplates = new CRM_Core_DAO_MessageTemplate();
- $messageTemplates->copyValues($params);
- if ($messageTemplates->find(TRUE)) {
- CRM_Core_DAO::storeValues($messageTemplates, $defaults);
- return $messageTemplates;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
}
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Core_BAO_Navigation|null
- * object on success, NULL otherwise
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $navigation = new CRM_Core_DAO_Navigation();
- $navigation->copyValues($params);
-
- $navigation->domain_id = CRM_Core_Config::domainID();
-
- if ($navigation->find(TRUE)) {
- CRM_Core_DAO::storeValues($navigation, $defaults);
- return $navigation;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ $params['domain_id'] = CRM_Core_Config::domainID();
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
class CRM_Core_BAO_OptionGroup extends CRM_Core_DAO_OptionGroup implements \Civi\Test\HookInterface {
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Core_BAO_OptionGroup
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $optionGroup = new CRM_Core_DAO_OptionGroup();
- $optionGroup->copyValues($params);
- if ($optionGroup->find(TRUE)) {
- CRM_Core_DAO::storeValues($optionGroup, $defaults);
- return $optionGroup;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
}
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Core_BAO_OptionValue
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $optionValue = new CRM_Core_DAO_OptionValue();
- $optionValue->copyValues($params);
- if ($optionValue->find(TRUE)) {
- CRM_Core_DAO::storeValues($optionValue, $defaults);
- return $optionValue;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
class CRM_Core_BAO_PreferencesDate extends CRM_Core_DAO_PreferencesDate {
/**
- * Static holder for the default LT.
- * @var string
- */
- public static $_defaultPreferencesDate = NULL;
-
- /**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Core_BAO_PreferencesDate|null
- * object on success, null otherwise
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $dao = new CRM_Core_DAO_PreferencesDate();
- $dao->copyValues($params);
- if ($dao->find(TRUE)) {
- CRM_Core_DAO::storeValues($dao, $defaults);
- return $dao;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
protected $tree;
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return object
- * CRM_Core_DAO_Tag object on success, otherwise null
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $tag = new CRM_Core_DAO_Tag();
- $tag->copyValues($params);
- if ($tag->find(TRUE)) {
- CRM_Core_DAO::storeValues($tag, $defaults);
- return $tag;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
}
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Core_BAO_UFField
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- return CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_UFField', $params, $defaults);
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement implements \Civi\Test\HookInterface {
/**
- * Function that must have never worked & should be removed.
- *
- * Retrieve DB object based on input parameters.
- *
- * It also stores all the retrieved values in the default array.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Core_DAO_WordReplacement
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- return CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_WordRepalcement', $params, $defaults);
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
* Fetch object based on array of properties.
*
* @param string $daoName
- * Name of the dao object.
+ * Name of the dao class.
* @param array $params
* (reference) an assoc array of name/value pairs.
* @param array $defaults
* (reference) an assoc array to hold the flattened values.
* @param array $returnProperities
- * An assoc array of fields that need to be returned, eg array( 'first_name', 'last_name').
+ * An assoc array of fields that need to be returned, e.g. ['first_name', 'last_name'].
*
* @return static|null
*/
const tz_fields = ['event_start_date', 'event_end_date', 'start_date', 'end_date', 'registration_start_date', 'registration_end_date'];
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Event_DAO_Event|null
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $event = new CRM_Event_DAO_Event();
- $event->copyValues($params);
- if ($event->find(TRUE)) {
- CRM_Core_DAO::storeValues($event, $defaults);
- return $event;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
}
/**
+ * Retrieve DB object and copy to defaults array.
+ *
* @param array $params
+ * Array of criteria values.
* @param array $defaults
+ * Array to be populated with found values.
+ *
+ * @return self|null
+ * The DAO object, if found.
*
- * @return CRM_Event_DAO_ParticipantStatusType|null
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $result = NULL;
-
- $dao = new CRM_Event_DAO_ParticipantStatusType();
- $dao->copyValues($params);
- if ($dao->find(TRUE)) {
- CRM_Core_DAO::storeValues($dao, $defaults);
- $result = $dao;
- }
-
- return $result;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
class CRM_Financial_BAO_FinancialAccount extends CRM_Financial_DAO_FinancialAccount implements \Civi\Test\HookInterface {
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Financial_BAO_FinancialAccount
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults = []) {
- $financialAccount = new CRM_Financial_DAO_FinancialAccount();
- $financialAccount->copyValues($params);
- if ($financialAccount->find(TRUE)) {
- CRM_Core_DAO::storeValues($financialAccount, $defaults);
- return $financialAccount;
- }
- return NULL;
+ public static function retrieve($params, &$defaults = []) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem {
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Financial_DAO_FinancialItem
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $financialItem = new CRM_Financial_DAO_FinancialItem();
- $financialItem->copyValues($params);
- if ($financialItem->find(TRUE)) {
- CRM_Core_DAO::storeValues($financialItem, $defaults);
- return $financialItem;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
public static $_statusACLFt = [];
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Financial_DAO_FinancialType
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $financialType = new CRM_Financial_DAO_FinancialType();
- $financialType->copyValues($params);
- if ($financialType->find(TRUE)) {
- CRM_Core_DAO::storeValues($financialType, $defaults);
- return $financialType;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
}
/**
- * Retrieve DB object based on input parameters.
- *
- * It also stores all the retrieved values in the default array.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Financial_DAO_PaymentProcessor|null
- * object on success, null otherwise
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $paymentProcessor = new CRM_Financial_DAO_PaymentProcessor();
- $paymentProcessor->copyValues($params);
- if ($paymentProcessor->find(TRUE)) {
- CRM_Core_DAO::storeValues($paymentProcessor, $defaults);
- return $paymentProcessor;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
public static $_defaultPaymentProcessorType = NULL;
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
+ *
+ * @return self|null
+ * The DAO object, if found.
*
- * @return CRM_Core_BAO_LocationType|null
- * object on success, null otherwise
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $paymentProcessorType = new CRM_Financial_DAO_PaymentProcessorType();
- $paymentProcessorType->copyValues($params);
- if ($paymentProcessorType->find(TRUE)) {
- CRM_Core_DAO::storeValues($paymentProcessorType, $defaults);
- return $paymentProcessorType;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
}
/**
- * Given the list of params in the params array, fetch the object
- * and store the values in the values array
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * Input parameters to find object.
- * @param array $values
- * Output values of the object.
+ * Array of criteria values.
+ * @param array $defaults
+ * Array to be populated with found values.
+ *
+ * @return self|null
+ * The DAO object, if found.
*
- * @return array
- * values
+ * @deprecated
*/
- public static function retrieve(&$params, &$values) {
- $friend = new CRM_Friend_DAO_Friend();
- $friend->copyValues($params);
- $friend->find(TRUE);
- CRM_Core_DAO::storeValues($friend, $values);
- return $values;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
class CRM_Mailing_BAO_MailingComponent extends CRM_Mailing_DAO_MailingComponent {
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
+ *
+ * @return self|null
+ * The DAO object, if found.
*
- * @return CRM_Core_BAO_LocationType.
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $component = new CRM_Mailing_DAO_MailingComponent();
- $component->copyValues($params);
- if ($component->find(TRUE)) {
- CRM_Core_DAO::storeValues($component, $defaults);
- return $component;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus implements \Civi\Test\HookInterface {
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Member_BAO_MembershipStatus
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $membershipStatus = new CRM_Member_DAO_MembershipStatus();
- $membershipStatus->copyValues($params);
- if ($membershipStatus->find(TRUE)) {
- CRM_Core_DAO::storeValues($membershipStatus, $defaults);
- return $membershipStatus;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
public static $_membershipTypeInfo = [];
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Member_BAO_MembershipType
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $membershipType = new CRM_Member_DAO_MembershipType();
- $membershipType->copyValues($params);
- if ($membershipType->find(TRUE)) {
- CRM_Core_DAO::storeValues($membershipType, $defaults);
- return $membershipType;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
public static $_exportableFields = NULL;
/**
- * Retrieve DB object based on input parameters.
- *
- * It also stores all the retrieved values in the default array.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
+ *
+ * @return self|null
+ * The DAO object, if found.
*
- * @return CRM_Pledge_BAO_Pledge
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $pledge = new CRM_Pledge_DAO_Pledge();
- $pledge->copyValues($params);
- if ($pledge->find(TRUE)) {
- CRM_Core_DAO::storeValues($pledge, $defaults);
- return $pledge;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock {
/**
- * Retrieve DB object based on input parameters.
- *
- * It also stores all the retrieved values in the default array.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Pledge_BAO_PledgeBlock
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $pledgeBlock = new CRM_Pledge_DAO_PledgeBlock();
- $pledgeBlock->copyValues($params);
- if ($pledgeBlock->find(TRUE)) {
- CRM_Core_DAO::storeValues($pledgeBlock, $defaults);
- return $pledgeBlock;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
}
/**
- * Retrieve DB object based on input parameters.
- *
- * It also stores all the retrieved values in the default array.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
+ *
+ * @return self|null
+ * The DAO object, if found.
*
- * @return CRM_Pledge_BAO_PledgePayment
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- $payment = new CRM_Pledge_BAO_PledgePayment();
- $payment->copyValues($params);
- if ($payment->find(TRUE)) {
- CRM_Core_DAO::storeValues($payment, $defaults);
- return $payment;
- }
- return NULL;
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
}
/**
- * Retrieve DB object based on input parameters.
- *
- * It also stores all the retrieved values in the default array.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Price_BAO_LineItem
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params = [], &$defaults = []) {
- $lineItem = new CRM_Price_BAO_LineItem();
- $lineItem->copyValues($params);
- if ($lineItem->find(TRUE)) {
- CRM_Core_DAO::storeValues($lineItem, $defaults);
- return $lineItem;
- }
- return NULL;
+ public static function retrieve($params, &$defaults = []) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
}
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Price_DAO_PriceField
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- return CRM_Core_DAO::commonRetrieve('CRM_Price_DAO_PriceField', $params, $defaults);
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
}
/**
- * Retrieve DB object based on input parameters.
- *
- * It also stores all the retrieved values in the default array.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Price_DAO_PriceFieldValue
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- return CRM_Core_DAO::commonRetrieve('CRM_Price_DAO_PriceFieldValue', $params, $defaults);
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
}
/**
- * Fetch object based on array of properties.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
+ * Array of criteria values.
* @param array $defaults
- * (reference ) an assoc array to hold the flattened values.
+ * Array to be populated with found values.
*
- * @return CRM_Price_DAO_PriceSet
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
- public static function retrieve(&$params, &$defaults) {
- return CRM_Core_DAO::commonRetrieve('CRM_Price_DAO_PriceSet', $params, $defaults);
+ public static function retrieve($params, &$defaults) {
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**
}
/**
- * Retrieve instance.
+ * Retrieve DB object and copy to defaults array.
*
* @param array $params
+ * Array of criteria values.
* @param array $defaults
+ * Array to be populated with found values.
*
- * @return CRM_Report_DAO_ReportInstance|null
+ * @return self|null
+ * The DAO object, if found.
+ *
+ * @deprecated
*/
public static function retrieve($params, &$defaults) {
- $instance = new CRM_Report_DAO_ReportInstance();
- $instance->copyValues($params);
-
- if ($instance->find(TRUE)) {
- CRM_Core_DAO::storeValues($instance, $defaults);
- return $instance;
- }
- return NULL;
+ return self::commonRetrieve(self::class, $params, $defaults);
}
/**