本文整理汇总了PHP中Vtiger_Utils::isNumber方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Utils::isNumber方法的具体用法?PHP Vtiger_Utils::isNumber怎么用?PHP Vtiger_Utils::isNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Utils
的用法示例。
在下文中一共展示了Vtiger_Utils::isNumber方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInstance
public static function getInstance($value)
{
$db = PearDatabase::getInstance();
if (Vtiger_Utils::isNumber($value)) {
$sql = 'SELECT * FROM vtiger_org_share_action_mapping WHERE share_action_id = ?';
} else {
$sql = 'SELECT * FROM vtiger_org_share_action_mapping WHERE share_action_name = ?';
}
$params = array($value);
$result = $db->pquery($sql, $params);
if ($db->num_rows($result) > 0) {
return self::getInstanceFromQResult($result);
}
return null;
}
示例2: getInstance
public static function getInstance($id)
{
$db = PearDatabase::getInstance();
if (Vtiger_Utils::isNumber($id)) {
$query = 'SELECT * FROM ' . Settings_Currency_Module_Model::tableName . ' WHERE id=?';
} else {
$query = 'SELECT * FROM ' . Settings_Currency_Module_Model::tableName . ' WHERE currency_name=?';
}
$params = array($id);
$result = $db->pquery($query, $params);
if ($db->num_rows($result) > 0) {
$instance = new self();
$row = $db->query_result_rowdata($result, 0);
$instance->setData($row);
}
return $instance;
}
示例3: 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;
}
}
示例4: getInstance
/**
* Get instance by filterid or filtername
* @param mixed filterid or filtername
* @param Vtiger_Module Instance of the module to use when filtername is used
*/
static function getInstance($value, $moduleInstance = false)
{
global $adb;
$instance = false;
$query = false;
$queryParams = false;
if (Vtiger_Utils::isNumber($value)) {
$query = "SELECT * FROM vtiger_customview WHERE cvid=?";
$queryParams = array($value);
} else {
$query = "SELECT * FROM vtiger_customview WHERE viewname=? AND entitytype=?";
$queryParams = array($value, $moduleInstance->name);
}
$result = $adb->pquery($query, $queryParams);
if ($adb->num_rows($result)) {
$instance = new self();
$instance->initialize($adb->fetch_array($result), $moduleInstance);
}
return $instance;
}
示例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($value)
{
$db = PearDatabase::getInstance();
$instance = false;
$query = false;
if (Vtiger_Utils::isNumber($value)) {
$query = 'SELECT * FROM vtiger_def_org_share INNER JOIN vtiger_tab ON vtiger_tab.tabid = vtiger_def_org_share.tabid WHERE vtiger_tab.tabid=?';
} else {
$query = 'SELECT * FROM vtiger_def_org_share INNER JOIN vtiger_tab ON vtiger_tab.tabid = vtiger_def_org_share.tabid WHERE name=?';
}
$result = $db->pquery($query, array($value));
if ($db->num_rows($result)) {
$row = $db->query_result_rowdata($result, 0);
$instance = new Settings_SharingAccess_Module_Model();
$instance->initialize($row);
$instance->set('permission', $row['permission']);
$instance->set('editstatus', $row['editstatus']);
}
return $instance;
}
示例6: getInstance
/**
* Get instance of menu by label
* @param String Menu label
*/
static function getInstance($value)
{
global $adb;
$query = false;
$instance = false;
if (Vtiger_Utils::isNumber($value)) {
$query = "SELECT * FROM vtiger_parenttab WHERE parenttabid=?";
} else {
$query = "SELECT * FROM vtiger_parenttab WHERE parenttab_label=?";
}
$result = $adb->pquery($query, array($value));
if ($adb->num_rows($result)) {
$instance = new self();
$instance->initialize($adb->fetch_array($result));
}
return $instance;
}
示例7: getInstanceWithIdOrName
public static function getInstanceWithIdOrName($value)
{
global $log;
$log->debug("Entering Vtiger_Action_Model::getInstanceWithIdOnName(" . $value . ") method ...");
$db = PearDatabase::getInstance();
if (Vtiger_Utils::isNumber($value)) {
$sql = 'SELECT * FROM vtiger_actionmapping WHERE actionid=? LIMIT 1';
} else {
$sql = 'SELECT * FROM vtiger_actionmapping WHERE actionname=?';
}
$params = array($value);
$result = $db->pquery($sql, $params);
if ($db->num_rows($result) > 0) {
$log->debug("Exiting Vtiger_Action_Model::getInstanceWithIdOnName(" . $value . ") method ...");
return self::getInstanceFromQResult($result);
}
$log->debug("Exiting Vtiger_Action_Model::getInstanceWithIdOnName(" . $value . ") method ...");
return null;
}