本文整理匯總了PHP中Operation::QuerySingle方法的典型用法代碼示例。如果您正苦於以下問題:PHP Operation::QuerySingle方法的具體用法?PHP Operation::QuerySingle怎麽用?PHP Operation::QuerySingle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Operation
的用法示例。
在下文中一共展示了Operation::QuerySingle方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: RestoreByNameForClass
public static function RestoreByNameForClass($strName, $intClassId, $strVersion, $objFile)
{
$objOperation = Operation::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::Operation()->QcodoClassId, $intClassId), QQ::Equal(QQN::Operation()->Name, $strName)));
if (!$objOperation) {
$objOperation = new Operation();
$objOperation->Name = $strName;
$objOperation->QcodoClassId = $intClassId;
$objOperation->FirstVersion = $strVersion;
$objOperation->File = $objFile;
$objOperation->Save();
} else {
$blnSave = false;
if ($objOperation->LastVersion) {
$objOperation->LastVersion = null;
$blnSave = true;
}
if ($objFile->Id != $objOperation->intFileId) {
$objOperation->File = $objFile;
$blnSave = true;
}
if ($blnSave) {
$objOperation->Save();
}
}
return $objOperation;
}
示例2: GetItemId
protected function GetItemId($strClassName, $strType = null, $strName = null)
{
$objClass = QcodoClass::LoadByName($strClassName);
if (!$objClass) {
return null;
}
$strToReturn = $objClass->Id;
$this->tnvNavigation->GetItem($objClass->Id)->Expanded = true;
switch (strtolower($strType)) {
case 'methods':
case 'functions':
if (count($objClass->Operations)) {
$strToReturn .= 'm';
$objOperation = Operation::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::Operation()->QcodoClassId, $objClass->Id), QQ::Equal(QQN::Operation()->Name, $strName)));
if ($objOperation) {
$strToReturn .= $objOperation->Id;
}
}
break;
case 'properties':
if (count($objClass->GetPropertiesForVariableGroupId(null))) {
$strToReturn .= 'p';
}
break;
case 'variables':
case 'membervariables':
if (count($objClass->GetVariablesForVariableGroupId(null))) {
$strToReturn .= 'v';
}
break;
case 'constants':
if ($objClass->CountQcodoConstants()) {
$strToReturn .= 'c';
}
break;
default:
break;
}
return $strToReturn;
}
示例3: LoadByQcodoClassIdQcodoInterfaceIdName
/**
* Load a single Operation object,
* by QcodoClassId, QcodoInterfaceId, Name Index(es)
* @param integer $intQcodoClassId
* @param integer $intQcodoInterfaceId
* @param string $strName
* @return Operation
*/
public static function LoadByQcodoClassIdQcodoInterfaceIdName($intQcodoClassId, $intQcodoInterfaceId, $strName)
{
return Operation::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::Operation()->QcodoClassId, $intQcodoClassId), QQ::Equal(QQN::Operation()->QcodoInterfaceId, $intQcodoInterfaceId), QQ::Equal(QQN::Operation()->Name, $strName)));
}