本文整理匯總了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;
}
示例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;
}
示例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;
}