本文整理汇总了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;
}