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


PHP Variable::CreateNewForName方法代码示例

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


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

示例1: RestoreByNameForClass

 public static function RestoreByNameForClass($strName, $intClassId, $strVersion)
 {
     $objClassProperty = ClassProperty::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::ClassProperty()->QcodoClassId, $intClassId), QQ::Equal(QQN::ClassProperty()->Variable->Name, $strName)));
     if (!$objClassProperty) {
         $objConnectedClassVariable = ClassVariable::LoadByPartialNameForClass($strName, $intClassId);
         $objVariable = Variable::CreateNewForName($strName, $strVersion);
         $objClassProperty = new ClassProperty();
         $objClassProperty->QcodoClassId = $intClassId;
         $objClassProperty->VariableGroupId = 1;
         $objClassProperty->Variable = $objVariable;
         if ($objConnectedClassVariable) {
             $objClassProperty->ClassVariable = $objConnectedClassVariable;
             $objClassProperty->VariableGroupId = $objConnectedClassVariable->VariableGroupId;
         }
         $objClassProperty->Save();
     } else {
         if ($objClassProperty->Variable->LastVersion) {
             $objClassProperty->Variable->LastVersion = null;
             $objClassProperty->Variable->Save();
         }
         if ($objClassProperty->ClassVariable) {
             $objClassProperty->VariableGroupId = $objClassProperty->ClassVariable->VariableGroupId;
             $objClassProperty->Save();
         }
     }
     return $objClassProperty;
 }
开发者ID:qcodo,项目名称:qcodo-api,代码行数:27,代码来源:ClassProperty.class.php

示例2: RestoreByNameForClass

 public static function RestoreByNameForClass($strName, $intClassId, $strVersion)
 {
     $objClassVariable = ClassVariable::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::ClassVariable()->QcodoClassId, $intClassId), QQ::Equal(QQN::ClassVariable()->Variable->Name, $strName)));
     if (!$objClassVariable) {
         $objVariable = Variable::CreateNewForName($strName, $strVersion);
         $objClassVariable = new ClassVariable();
         $objClassVariable->Variable = $objVariable;
         $objClassVariable->QcodoClassId = $intClassId;
         $objClassVariable->VariableGroupId = 1;
         $objClassVariable->ProtectionTypeId = ProtectionType::_Public;
         $objClassVariable->Save();
     } else {
         if ($objClassVariable->Variable->LastVersion) {
             $objClassVariable->Variable->LastVersion = null;
             $objClassVariable->Variable->Save();
         }
     }
     return $objClassVariable;
 }
开发者ID:qcodo,项目名称:qcodo-api,代码行数:19,代码来源:ClassVariable.class.php


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