当前位置: 首页>>代码示例>>PHP>>正文


PHP Vtiger_Cache类代码示例

本文整理汇总了PHP中Vtiger_Cache的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Cache类的具体用法?PHP Vtiger_Cache怎么用?PHP Vtiger_Cache使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Vtiger_Cache类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getNameFields

 /**
  * Function to retrieve name fields of a module
  * @return <array> - array which contains fields which together construct name fields
  */
 public function getNameFields()
 {
     $nameFieldObject = Vtiger_Cache::get('EntityField', $this->getName());
     $moduleName = $this->getName();
     if ($nameFieldObject && $nameFieldObject->fieldname) {
         $this->nameFields = explode(',', $nameFieldObject->fieldname);
     } else {
         $adb = PearDatabase::getInstance();
         $query = "SELECT fieldname, tablename, entityidfield FROM vtiger_entityname WHERE tabid = ?";
         $result = $adb->pquery($query, array(getTabid('Calendar')));
         $this->nameFields = array();
         if ($result) {
             $rowCount = $adb->num_rows($result);
             if ($rowCount > 0) {
                 $fieldNames = $adb->query_result($result, 0, 'fieldname');
                 $this->nameFields = explode(',', $fieldNames);
             }
         }
         $entiyObj = new stdClass();
         $entiyObj->basetable = $adb->query_result($result, 0, 'tablename');
         $entiyObj->basetableid = $adb->query_result($result, 0, 'entityidfield');
         $entiyObj->fieldname = $fieldNames;
         Vtiger_Cache::set('EntityField', $this->getName(), $entiyObj);
     }
     return $this->nameFields;
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:30,代码来源:Module.php

示例2: getConfig

 public static function getConfig($type)
 {
     $log = vglobal('log');
     $log->debug('Start ' . __CLASS__ . ':' . __FUNCTION__ . " | Type: {$type}");
     $cache = Vtiger_Cache::get('MarketingProcesses', $type);
     if ($cache) {
         $log->debug('End ' . __CLASS__ . ':' . __FUNCTION__);
         return $cache;
     }
     $db = PearDatabase::getInstance();
     $result = $db->pquery('SELECT * FROM yetiforce_proc_marketing WHERE type = ?;', [$type]);
     if ($db->num_rows($result) == 0) {
         return [];
     }
     $config = [];
     for ($i = 0; $i < $db->num_rows($result); ++$i) {
         $param = $db->query_result_raw($result, $i, 'param');
         $value = $db->query_result_raw($result, $i, 'value');
         if (in_array($param, ['groups', 'status', 'convert_status'])) {
             $config[$param] = $value == '' ? [] : explode(',', $value);
         } else {
             $config[$param] = $value;
         }
     }
     Vtiger_Cache::set('MarketingProcesses', $type, $config);
     $log->debug('End ' . __CLASS__ . ':' . __FUNCTION__);
     return $config;
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:28,代码来源:Module.php

示例3: getDisplayValue

 /**
  * Function to get the Display Value, for the current field type with given DB Insert Value
  * @param <Object> $value
  * @return <Object>
  */
 public function getDisplayValue($tree, $record = false, $recordInstance = false, $rawText = false)
 {
     $template = $this->get('field')->getFieldParams();
     $name = Vtiger_Cache::get('TreeData' . $template, $tree);
     if ($name) {
         return $name;
     }
     $adb = PearDatabase::getInstance();
     $result = $adb->pquery('SELECT * FROM vtiger_trees_templates_data WHERE templateid = ? AND tree = ?', [$template, $tree]);
     $parentName = '';
     $module = $this->get('field')->getModuleName();
     $name = false;
     if ($adb->num_rows($result)) {
         if ($adb->query_result_raw($result, 0, 'depth') > 0) {
             $parenttrre = $adb->query_result_raw($result, 0, 'parenttrre');
             $cut = strlen('::' . $tree);
             $parenttrre = substr($parenttrre, 0, -$cut);
             $pieces = explode('::', $parenttrre);
             $parent = end($pieces);
             $result2 = $adb->pquery("SELECT name FROM vtiger_trees_templates_data WHERE templateid = ? AND tree = ?", [$template, $parent]);
             $parentName = $adb->query_result_raw($result2, 0, 'name');
             $parentName = '(' . vtranslate($parentName, $module) . ') ';
         }
         $name = $parentName . vtranslate($adb->query_result($result, 0, 'name'), $module);
     }
     Vtiger_Cache::set('TreeData' . $template, $tree, $name);
     return $name;
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:33,代码来源:Tree.php

示例4: getConfig

 public static function getConfig($process, $type, $procesParam = false)
 {
     $log = vglobal('log');
     $log->debug('Start ' . __CLASS__ . ':' . __FUNCTION__ . " | Process: {$process}, Type: {$type}");
     $db = PearDatabase::getInstance();
     $processList = ['marketing' => 'yetiforce_proc_marketing', 'sales' => 'yetiforce_proc_sales'];
     $cache = Vtiger_Cache::get('ProcessesModel', $process . $type);
     if ($cache) {
         $log->debug('End ' . __CLASS__ . ':' . __FUNCTION__);
         return $cache;
     }
     $result = $db->pquery('SELECT * FROM ' . $processList[$process] . ' WHERE type = ?;', [$type]);
     if ($db->num_rows($result) == 0) {
         return [];
     }
     $config = [];
     for ($i = 0; $i < $db->num_rows($result); ++$i) {
         $param = $db->query_result_raw($result, $i, 'param');
         $value = $db->query_result_raw($result, $i, 'value');
         if ($param == 'users') {
             $config[$param] = $value == '' ? [] : explode(',', $value);
         } else {
             $config[$param] = $value;
         }
         if ($procesParam != false && $param == $procesParam) {
             Vtiger_Cache::set('ProcessesModel', $process . $type . $procesParam, $value);
             $log->debug('End ' . __CLASS__ . ':' . __FUNCTION__);
             return $value;
         }
     }
     Vtiger_Cache::set('ProcessesModel', $process . $type, $config);
     $log->debug('End ' . __CLASS__ . ':' . __FUNCTION__);
     return $config;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:34,代码来源:Processes.php

示例5: getInstance

 /**
  * Static Function to get the instance of Vtiger Module Model for the given id or name
  * @param mixed id or name of the module
  */
 public static function getInstance()
 {
     $instance = Vtiger_Cache::get('calendar', $value);
     if (!$instance) {
         $instance = new self();
     }
     return $instance;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:12,代码来源:Calendar.php

示例6: getInstance

	/**
	 * Get invnetory instance
	 * @param string $moduleName Module name
	 * @return Vtiger_Inventory_Model instance
	 */
	public static function getInstance($moduleName)
	{
		$instance = Vtiger_Cache::get('Inventory', $moduleName);
		if (!$instance) {
			$modelClassName = Vtiger_Loader::getComponentClassName('Model', 'Inventory', $moduleName);
			$instance = new $modelClassName();
			$instance->initialize($moduleName);
			Vtiger_Cache::set('Inventory', $moduleName, $instance);
		}
		return $instance;
	}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:16,代码来源:Inventory.php

示例7: getInstance

 public static function getInstance($module)
 {
     $instance = Vtiger_Cache::get('transferOwnership', $module);
     if (!$instance) {
         $modelClassName = Vtiger_Loader::getComponentClassName('Model', 'TransferOwnership', $module);
         $instance = new $modelClassName();
         $instance->set('module', $module);
         Vtiger_Cache::set('transferOwnership', $module, $instance);
     }
     return $instance;
 }
开发者ID:epsilonsc,项目名称:YetiForceCRM,代码行数:11,代码来源:TransferOwnership.php

示例8: getTaxes

 /**
  * Function to get all the available picklist values for the current field
  * @return <Array> List of picklist values if the field is of type picklist or multipicklist, null otherwise.
  */
 public function getTaxes()
 {
     $taxs = Vtiger_Cache::get('taxes', 'global');
     if (!$taxs) {
         $db = PearDatabase::getInstance();
         $taxs = [];
         $result = $db->pquery('SELECT * FROM a_yf_taxes_global WHERE status = ?', [0]);
         while ($row = $db->fetch_array($result)) {
             $taxs[$row['id']] = $row;
         }
         Vtiger_Cache::set('taxes', 'global', $taxs);
     }
     return $taxs;
 }
开发者ID:vovpff,项目名称:YetiForceCRM,代码行数:18,代码来源:Taxes.php

示例9: getLimits

 /**
  * Function to get all the available picklist values for the current field
  * @return <Array> List of picklist values if the field is of type picklist or multipicklist, null otherwise.
  */
 public function getLimits()
 {
     $limits = Vtiger_Cache::get('Inventory', 'limits');
     if (!$limits) {
         $db = PearDatabase::getInstance();
         $limits = [];
         $result = $db->pquery('SELECT * FROM a_yf_inventory_limits WHERE status = ?', [0]);
         while ($row = $db->fetch_array($result)) {
             $limits[$row['id']] = $row;
         }
         Vtiger_Cache::set('Inventory', 'limits', $limits);
     }
     return $limits;
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:18,代码来源:InventoryLimit.php

示例10: getMultiReferenceValueFields

 /**
  * Loading the list of multireference fields
  * @param string $sourceModule Source module name
  * @param string $destinationModule Destination module name
  * @return array
  */
 public function getMultiReferenceValueFields($sourceModule, $destinationModule)
 {
     $return = Vtiger_Cache::get('mrvf-' . $sourceModule, $destinationModule);
     if (!$return) {
         $db = PearDatabase::getInstance();
         $query = 'SELECT * FROM vtiger_field WHERE tabid = ? AND presence <> ? AND fieldparams LIKE \'{"module":"' . $destinationModule . '"%\';';
         $result = $db->pquery($query, [Vtiger_Functions::getModuleId($sourceModule), 1]);
         $return = [];
         while ($field = $db->fetch_array($result)) {
             $return[] = $field;
         }
         Vtiger_Cache::set('mrvf-' . $sourceModule, $destinationModule, $return);
     }
     return $return;
 }
开发者ID:noclav,项目名称:UpdatePackages,代码行数:21,代码来源:MultiReferenceValue.php

示例11: getInstanceById

 /**
  * Function to get the instance of the CompanyDetails model for a given organization id
  * @param <Number> $id
  * @return Vtiger_CompanyDetails_Model instance
  */
 public static function getInstanceById($id = 1) {
     $companyDetails = Vtiger_Cache::get('vtiger', 'organization');
     if (!$companyDetails) {
         $db = PearDatabase::getInstance();
         $sql = 'SELECT * FROM vtiger_organizationdetails WHERE organization_id=?';
         $params = array($id);
         $result = $db->pquery($sql, $params);
         $companyDetails = new self();
         if ($result && $db->num_rows($result) > 0) {
             $resultRow = $db->query_result_rowdata($result, 0);
             $companyDetails->setData($resultRow);
         }
         Vtiger_Cache::set('vtiger','organization',$companyDetails);
     }
     return $companyDetails;
 }
开发者ID:Wasage,项目名称:werpa,代码行数:21,代码来源:CompanyDetails.php

示例12: getConfig

 public static function getConfig($type = false)
 {
     $log = vglobal('log');
     $log->debug('Start ' . __CLASS__ . ':' . __FUNCTION__ . " | Type: {$type}");
     $cache = Vtiger_Cache::get('SalesProcesses', $type == false ? 'all' : $type);
     if ($cache) {
         $log->debug('End ' . __CLASS__ . ':' . __FUNCTION__);
         return $cache;
     }
     $db = PearDatabase::getInstance();
     $params = [];
     $returnArrayForFields = ['groups', 'status', 'calculationsstatus', 'salesstage', 'salesstage', 'assetstatus'];
     $sql = 'SELECT * FROM yetiforce_proc_sales';
     if ($type) {
         $sql .= ' WHERE type = ?';
         $params[] = $type;
     }
     $result = $db->pquery($sql, $params);
     if ($db->num_rows($result) == 0) {
         return [];
     }
     $config = [];
     for ($i = 0; $i < $db->num_rows($result); ++$i) {
         $param = $db->query_result_raw($result, $i, 'param');
         $value = $db->query_result_raw($result, $i, 'value');
         if (in_array($param, $returnArrayForFields)) {
             $value = $value == '' ? [] : explode(',', $value);
         }
         if ($type) {
             $config[$param] = $value;
         } else {
             $config[$db->query_result_raw($result, $i, 'type')][$param] = $value;
         }
     }
     Vtiger_Cache::set('SalesProcesses', $type == false ? 'all' : $type, $config);
     $log->debug('End ' . __CLASS__ . ':' . __FUNCTION__);
     return $config;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:38,代码来源:Module.php

示例13: getPicklistDetails

 function getPicklistDetails()
 {
     $cache = Vtiger_Cache::getInstance();
     if ($cache->getPicklistDetails($this->getTabId(), $this->getFieldName())) {
         return $cache->getPicklistDetails($this->getTabId(), $this->getFieldName());
     } else {
         $hardCodedPickListNames = array("hdntaxtype", "email_flag");
         $hardCodedPickListValues = array("hdntaxtype" => array(array("label" => "Individual", "value" => "individual"), array("label" => "Group", "value" => "group")), "email_flag" => array(array('label' => 'SAVED', 'value' => 'SAVED'), array('label' => 'SENT', 'value' => 'SENT'), array('label' => 'MAILSCANNER', 'value' => 'MAILSCANNER')));
         if (in_array(strtolower($this->getFieldName()), $hardCodedPickListNames)) {
             return $hardCodedPickListValues[strtolower($this->getFieldName())];
         }
         $picklistDetails = $this->getPickListOptions($this->getFieldName());
         $cache->setPicklistDetails($this->getTabId(), $this->getFieldName(), $picklistDetails);
         return $picklistDetails;
     }
 }
开发者ID:rcrrich,项目名称:YetiForceCRM,代码行数:16,代码来源:WebserviceField.php

示例14: getInstance

 /**
  * Get instance of block
  * @param mixed block id or block label
  * @param Vtiger_Module Instance of the module if block label is passed
  */
 static function getInstance($value, $moduleInstance = false)
 {
     global $adb;
     $cache = Vtiger_Cache::getInstance();
     if ($moduleInstance && $cache->getBlockInstance($value, $moduleInstance->id)) {
         return $cache->getBlockInstance($value, $moduleInstance->id);
     } else {
         $instance = false;
         $query = false;
         $queryParams = false;
         if (Vtiger_Utils::isNumber($value)) {
             $query = "SELECT * FROM vtiger_blocks WHERE blockid=?";
             $queryParams = array($value);
         } else {
             $query = "SELECT * FROM vtiger_blocks WHERE blocklabel=? AND tabid=?";
             $queryParams = array($value, $moduleInstance->id);
         }
         $result = $adb->pquery($query, $queryParams);
         if ($adb->num_rows($result)) {
             $instance = new self();
             $instance->initialize($adb->fetch_array($result), $moduleInstance);
         }
         $cache->setBlockInstance($value, $instance->module->id, $instance);
         return $instance;
     }
 }
开发者ID:gitter-badger,项目名称:openshift-salesplatform,代码行数:31,代码来源:Block.php

示例15: getAccessibleGroups

 /**
  * Function to get all the accessible groups
  * @return <Array>
  */
 public function getAccessibleGroups($private = "", $module = false)
 {
     //TODO:Remove dependence on $_REQUEST for the module name in the below API
     $accessibleGroups = Vtiger_Cache::get('vtiger-' . $private, 'accessiblegroups');
     if (!$accessibleGroups) {
         $accessibleGroups = get_group_array(false, "ACTIVE", "", $private, $module);
         Vtiger_Cache::set('vtiger-' . $private, 'accessiblegroups', $accessibleGroups);
     }
     return get_group_array(false, "ACTIVE", "", $private);
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:14,代码来源:Record.php


注:本文中的Vtiger_Cache类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。