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


PHP Vtiger_Functions::getEntityModuleSQLColumnString方法代码示例

本文整理汇总了PHP中Vtiger_Functions::getEntityModuleSQLColumnString方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Functions::getEntityModuleSQLColumnString方法的具体用法?PHP Vtiger_Functions::getEntityModuleSQLColumnString怎么用?PHP Vtiger_Functions::getEntityModuleSQLColumnString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Vtiger_Functions的用法示例。


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

示例1: getEntityField

/**
 * this function returns the entity field name for a given module; for e.g. for Contacts module it return concat(lastname, ' ', firstname)
 * @param string $module - the module name
 * @return string $fieldsname - the entity field name for the module
 */
function getEntityField($module)
{
    return Vtiger_Functions::getEntityModuleSQLColumnString($module);
}
开发者ID:jmangarret,项目名称:vtigercrm,代码行数:9,代码来源:CommonUtils.php

示例2: getAllUsersOnRoles

 /**
  * Function to get the users based on Roles
  * @param type $roles
  * @return <array>
  */
 public function getAllUsersOnRoles($roles)
 {
     $db = PearDatabase::getInstance();
     $roleIds = array();
     foreach ($roles as $key => $role) {
         $roleIds[] = $role->getId();
     }
     if (empty($roleIds)) {
         return array();
     }
     $sql = 'SELECT userid FROM vtiger_user2role WHERE roleid IN (' . generateQuestionMarks($roleIds) . ')';
     $result = $db->pquery($sql, $roleIds);
     $noOfUsers = $db->num_rows($result);
     $userIds = array();
     $subUsers = array();
     if ($noOfUsers > 0) {
         for ($i = 0; $i < $noOfUsers; ++$i) {
             $userIds[] = $db->query_result($result, $i, 'userid');
         }
         $entityData = Vtiger_Functions::getEntityModuleSQLColumnString('Users');
         $query = 'SELECT id, ' . $entityData['colums'] . ' FROM vtiger_users WHERE status = ? AND id IN (' . generateQuestionMarks($userIds) . ')';
         $query .= ' order by last_name ASC, first_name ASC';
         $result = $db->pquery($query, array('ACTIVE', $userIds));
         while ($row = $db->fetch_array($result)) {
             $colums = [];
             foreach (explode(',', $entityData['fieldname']) as $fieldname) {
                 $colums[] = $row[$fieldname];
             }
             $subUsers[$row['id']] = implode(' ', $colums);
         }
     }
     return $subUsers;
 }
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:38,代码来源:Record.php

示例3: getUserName

 public static function getUserName($id)
 {
     $adb = PearDatabase::getInstance();
     if (!isset(self::$userIdNameCache[$id])) {
         $userModuleInfo = Vtiger_Functions::getEntityModuleSQLColumnString('Users');
         $result = $adb->query('SELECT id,' . $userModuleInfo['colums'] . ' FROM vtiger_users');
         while ($row = $adb->getRow($result)) {
             $userid = $row['id'];
             unset($row['id']);
             self::$userIdNameCache[$userid] = trim(implode(' ', $row));
         }
     }
     return isset(self::$userIdNameCache[$id]) ? self::$userIdNameCache[$id] : false;
 }
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:14,代码来源:SharedOwner.php


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