* @param boolean $name pseudoconstant to be flushed
*
*/
- public static function flush($name) {
- if (isset(self::$$name)) {
+ public static function flush($name = 'cache') {
+ if (property_exists(self, $name)) {
self::$$name = NULL;
}
}
$locationType->copyValues($params);
$locationType->save();
// clear getfields cache
- CRM_Core_PseudoConstant::flush('locationType');
+ CRM_Core_PseudoConstant::flush();
civicrm_api('phone', 'getfields', array('version' => 3, 'cache_clear' => 1));
return $locationType;
}
$this->_contactID = $this->organizationCreate();
$this->_locationType = $this->locationTypeCreate();
- CRM_Core_PseudoConstant::flush('locationType');
+ CRM_Core_PseudoConstant::flush();
$this->_params = array(
'contact_id' => $this->_contactID,
*/
public function testLocationTypeGet() {
// needed to get rid of cached values from previous tests
- CRM_Core_PseudoConstant::flush('locationType');
+ CRM_Core_PseudoConstant::flush();
$this->_contactID = $this->organizationCreate();
$loc = $this->locationTypeCreate();
$this->_locationType = $loc->id;
- CRM_Core_PseudoConstant::flush('locationType');
+ CRM_Core_PseudoConstant::flush();
$this->quickCleanup(array('civicrm_phone'));
$this->_params = array(
'contact_id' => $this->_contactID,