當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DataType::getID方法代碼示例

本文整理匯總了PHP中DataType::getID方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataType::getID方法的具體用法?PHP DataType::getID怎麽用?PHP DataType::getID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DataType的用法示例。


在下文中一共展示了DataType::getID方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getByDataType

 /**
  *
  * @param DataType $type
  * @return DataTypeValidator 
  */
 public static function getByDataType(DataType $type)
 {
     $res = array();
     $dataTypeID = DataBase::Current()->EscapeString($type->getID());
     $rows = DataBase::Current()->ReadRows("SELECT * FROM {'dbprefix'}datatype_validator WHERE dataType = '" . $dataTypeID . "'");
     foreach ($rows as $row) {
         $validator = new DataTypeValidator();
         $validator->id = $row->id;
         $validator->dataTypeID = $row->dataType;
         $validator->dataType = $type;
         $validator->select = $row->select;
         $validator->message = $row->message;
         $res[] = $validator;
     }
     return $res;
 }
開發者ID:srueegger,項目名稱:1zu12bB,代碼行數:21,代碼來源:datatypevalidator.php

示例2: getByDataType

 /**
  *
  * @param DataType $dataType
  * @return array 
  */
 public static function getByDataType(DataType $dataType)
 {
     $res = array();
     $dataTypeID = DataBase::Current()->EscapeString($dataType->getID());
     $fields = DataBase::Current()->ReadRows("SELECT * FROM {'dbprefix'}datafields WHERE datatype = '" . $dataTypeID . "'");
     foreach ($fields as $field) {
         $fieldObj = new DataField();
         $fieldObj->id = $field->id;
         $fieldObj->dataTypeID = $field->dataType;
         $fieldObj->dataType = $dataType;
         $fieldObj->displayName = $field->displayName;
         $fieldObj->dataName = $field->dataName;
         $fieldObj->validatorID = $field->validator;
         $res[] = $fieldObj;
     }
     return $res;
 }
開發者ID:srueegger,項目名稱:1zu12bB,代碼行數:22,代碼來源:datafield.php

示例3: GetByDataTypeAndApiKey

 /**
  *
  * @param DataType $type
  * @param string $apikey
  * @return DataTypeShare 
  */
 public static function GetByDataTypeAndApiKey(DataType $type, $apikey)
 {
     $res = null;
     $id = DataBase::Current()->EscapeString($type->getID());
     $apikey = DataBase::Current()->EscapeString($apikey);
     $row = DataBase::Current()->ReadRow("SELECT \n                                           * \n                                        FROM \n                                           {'dbprefix'}datatype_sharing\n                                        WHERE\n                                           datatype = " . $id . "\n                                           AND apikey = '" . $apikey . "'");
     if ($row) {
         $res = new DataTypeShare();
         $res->dataType = $type;
         $res->apiKey = $row->apikey;
         $res->name = $row->name;
     }
     return $res;
 }
開發者ID:srueegger,項目名稱:1zu12bB,代碼行數:20,代碼來源:datatypeshare.php


注:本文中的DataType::getID方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。