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


PHP KTUtil::whereToString方法代码示例

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


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

示例1: removeSetsFromDocumentType

 /**
  * Removes a non-generic fieldset from a given document type.
  *
  * (Generic fieldsets are made available to and are required for all
  * (subsequent) documents.  Non-generic fieldsets are made available
  * to and are required for all (subsequent) documents that have a
  * particular document type.)
  */
 function removeSetsFromDocumentType($oDocumentType, $aFieldsets)
 {
     if (is_object($oDocumentType)) {
         $iDocumentTypeId = $oDocumentType->getId();
     } else {
         $iDocumentTypeId = $oDocumentType;
     }
     if (!is_array($aFieldsets)) {
         $aFieldsets = array($aFieldsets);
     }
     if (empty($aFieldsets)) {
         return true;
     }
     $aIds = array();
     foreach ($aFieldsets as $oFieldset) {
         if (is_object($oFieldset)) {
             $iFieldsetId = $oFieldset->getId();
         } else {
             $iFieldsetId = $oFieldset;
         }
         $aIds[] = $iFieldsetId;
     }
     // Converts to (?, ?, ?) for query
     $sParam = DBUtil::paramArray($aIds);
     $aWhere = KTUtil::whereToString(array(array('document_type_id = ?', array($iDocumentTypeId)), array("fieldset_id IN ({$sParam})", $aIds)));
     $sTable = KTUtil::getTableName('document_type_fieldsets');
     $aQuery = array("DELETE FROM {$sTable} WHERE {$aWhere[0]}", $aWhere[1]);
     return DBUtil::runQuery($aQuery);
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:37,代码来源:metadatautil.inc.php

示例2: array

<?php

require_once "../../../config/dmsDefaults.php";
require_once KT_LIB_DIR . "/util/ktutil.inc";
$aSource = array(array("active = ?", array(true)), array("foo = ? AND asdf = ?", array(5, "ff")));
$aResults = KTUtil::whereToString($aSource);
$aExpectedResults = array("active = ? AND foo = ? AND asdf = ?", array(true, 5, "ff"));
if ($aResults === $aExpectedResults) {
    print "Success!\n";
} else {
    print "Failure!\n";
    print "Received: " . print_r($aResults, true) . "\n";
    print "Expected: " . print_r($aExpectedResults, true) . "\n";
}
开发者ID:5haman,项目名称:knowledgetree,代码行数:14,代码来源:testWhereToString.php

示例3: listGroups

 function listGroups($aGivenOptions = null)
 {
     if (is_null($aGivenOptions)) {
         $aGivenOptions = array();
     }
     $aDefaultOptions = array();
     $aOptions = kt_array_merge($aDefaultOptions, $aGivenOptions);
     $aWhere = array();
     /* if ($aOptions["active"] === true) {
            $aWhere[] = array("active = ?", true);
        } */
     $sWhere = KTUtil::whereToString($aWhere);
     return Group::getList($sWhere);
 }
开发者ID:jpbauer,项目名称:knowledgetree,代码行数:14,代码来源:GroupUtil.php


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