Ejemplo n.º 1
0
 static function deleteGroup($group = null)
 {
     $dao = new CRM_Core_DAO_Cache();
     if (!empty($group)) {
         $dao->group_name = $group;
     }
     $dao->delete();
     // also reset ACL Cache
     require_once 'CRM/ACL/BAO/Cache.php';
     CRM_ACL_BAO_Cache::resetCache();
 }
Ejemplo n.º 2
0
 /**
  * Delete all the cache elements that belong to a group OR delete the entire cache if group is not specified.
  *
  * @param string $group
  *   The group name of the entries to be deleted.
  * @param string $path
  *   Path of the item that needs to be deleted.
  * @param bool $clearAll clear all caches
  */
 public static function deleteGroup($group = NULL, $path = NULL, $clearAll = TRUE)
 {
     $dao = new CRM_Core_DAO_Cache();
     if (!empty($group)) {
         $dao->group_name = $group;
     }
     if (!empty($path)) {
         $dao->path = $path;
     }
     $dao->delete();
     if ($clearAll) {
         // also reset ACL Cache
         CRM_ACL_BAO_Cache::resetCache();
         // also reset memory cache if any
         CRM_Utils_System::flushCache();
     }
 }
Ejemplo n.º 3
0
 /**
  * Returns the list of fields that can be exported
  *
  * @param bool $prefix
  *
  * @return array
  */
 static function &export($prefix = false)
 {
     if (!self::$_export) {
         self::$_export = array();
         $fields = self::fields();
         foreach ($fields as $name => $field) {
             if (CRM_Utils_Array::value('export', $field)) {
                 if ($prefix) {
                     self::$_export['cache'] =& $fields[$name];
                 } else {
                     self::$_export[$name] =& $fields[$name];
                 }
             }
         }
     }
     return self::$_export;
 }