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


PHP QQN::QcodoConstant方法代码示例

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


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

示例1: RestoreByNameForClass

 public static function RestoreByNameForClass($strName, $intClassId, $strVersion, $objFile)
 {
     $objConstant = QcodoConstant::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::QcodoConstant()->QcodoClassId, $intClassId), QQ::Equal(QQN::QcodoConstant()->Variable->Name, $strName)));
     if (!$objConstant) {
         $objVariable = new Variable();
         $objVariable->Name = $strName;
         $objVariable->VariableTypeId = VariableType::String;
         $objVariable->FirstVersion = $strVersion;
         $objVariable->Save();
         $objConstant = new QcodoConstant();
         $objConstant->Variable = $objVariable;
         $objConstant->File = $objFile;
         $objConstant->QcodoClassId = $intClassId;
         $objConstant->Save();
     } else {
         if ($objConstant->Variable->LastVersion) {
             $objConstant->Variable->LastVersion = null;
             $objConstant->Variable->Save();
         }
         if ($objFile->Id != $objConstant->intFileId) {
             $objConstant->File = $objFile;
             $objConstant->Save();
         }
     }
     return $objConstant;
 }
开发者ID:qcodo,项目名称:qcodo-api,代码行数:26,代码来源:QcodoConstant.class.php

示例2: __set

 public function __set($strName, $mixValue)
 {
     switch ($strName) {
         case "Expanded":
             $this->blnExpanded = $mixValue;
             if (!$this->blnDataBound) {
                 $this->blnDataBound = true;
                 // Get the class in question
                 $intClassId = $this->strItemId;
                 $objClass = QcodoClass::Load($intClassId);
                 // Bind Children
                 foreach ($objClass->Operations as $objOperation) {
                     new QTreeNavItem($objOperation->DisplayName, $intClassId . 'm' . $objOperation->Id, false, $this->objTreeNav->GetItem($intClassId . 'm'), $intClassId . 'm' . $objOperation->Id);
                 }
                 foreach ($objClass->GetPropertiesForVariableGroupId(null) as $objProperty) {
                     new QTreeNavItem($objProperty->DisplayName, $intClassId . 'p' . $objProperty->Id, false, $this->objTreeNav->GetItem($intClassId . 'p'), $intClassId . 'p' . $objProperty->Id);
                 }
                 foreach ($objClass->GetVariablesForVariableGroupId(null) as $objClassVariable) {
                     new QTreeNavItem($objClassVariable->DisplayName, $intClassId . 'v' . $objClassVariable->Id, false, $this->objTreeNav->GetItem($intClassId . 'v'), $intClassId . 'v' . $objClassVariable->Id);
                 }
                 foreach ($objClass->GetQcodoConstantArray(QQ::Clause(QQ::OrderBy(QQN::QcodoConstant()->Variable->Name))) as $objConstant) {
                     new QTreeNavItem($objConstant->Variable->Name, $intClassId . 'c' . $objConstant->Id, false, $this->objTreeNav->GetItem($intClassId . 'c'), $intClassId . 'c' . $objConstant->Id);
                 }
             }
             break;
         default:
             try {
                 return parent::__set($strName, $mixValue);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
开发者ID:qcodo,项目名称:qcodo-api,代码行数:34,代码来源:TreeNavItemCustom.class.php

示例3: Form_Create

 protected function Form_Create()
 {
     // Setup DataGrid Columns
     $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgQcodoConstant_EditLinkColumn_Render($_ITEM) ?>');
     $this->colEditLinkColumn->HtmlEntities = false;
     $this->colId = new QDataGridColumn(QApplication::Translate('Id'), '<?= $_ITEM->Id; ?>', array('OrderByClause' => QQ::OrderBy(QQN::QcodoConstant()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::QcodoConstant()->Id, false)));
     $this->colQcodoClassId = new QDataGridColumn(QApplication::Translate('Qcodo Class Id'), '<?= $_FORM->dtgQcodoConstant_QcodoClass_Render($_ITEM); ?>');
     $this->colVariableId = new QDataGridColumn(QApplication::Translate('Variable Id'), '<?= $_FORM->dtgQcodoConstant_Variable_Render($_ITEM); ?>');
     $this->colFileId = new QDataGridColumn(QApplication::Translate('File Id'), '<?= $_FORM->dtgQcodoConstant_File_Render($_ITEM); ?>');
     // Setup DataGrid
     $this->dtgQcodoConstant = new QDataGrid($this);
     $this->dtgQcodoConstant->CellSpacing = 0;
     $this->dtgQcodoConstant->CellPadding = 4;
     $this->dtgQcodoConstant->BorderStyle = QBorderStyle::Solid;
     $this->dtgQcodoConstant->BorderWidth = 1;
     $this->dtgQcodoConstant->GridLines = QGridLines::Both;
     // Datagrid Paginator
     $this->dtgQcodoConstant->Paginator = new QPaginator($this->dtgQcodoConstant);
     $this->dtgQcodoConstant->ItemsPerPage = 10;
     // Specify Whether or Not to Refresh using Ajax
     $this->dtgQcodoConstant->UseAjax = false;
     // Specify the local databind method this datagrid will use
     $this->dtgQcodoConstant->SetDataBinder('dtgQcodoConstant_Bind');
     $this->dtgQcodoConstant->AddColumn($this->colEditLinkColumn);
     $this->dtgQcodoConstant->AddColumn($this->colId);
     $this->dtgQcodoConstant->AddColumn($this->colQcodoClassId);
     $this->dtgQcodoConstant->AddColumn($this->colVariableId);
     $this->dtgQcodoConstant->AddColumn($this->colFileId);
 }
开发者ID:qcodo,项目名称:qcodo-api,代码行数:29,代码来源:QcodoConstantListFormBase.class.php

示例4: __construct

 public function __construct(QcodoClass $objQcodoClass, $objParentControl, $strControlId = null)
 {
     parent::__construct($objParentControl, $strControlId);
     // We're looking at ALL Methods/Operations
     $this->objQcodoClass = $objQcodoClass;
     $this->strUrl = 'http://' . $_SERVER['HTTP_HOST'] . '/index.php/' . $this->objQcodoClass->Name . '/Constants';
     $this->strTemplate = 'ConstantPanel.tpl.php';
     $this->objConstantArray = $this->objQcodoClass->GetQcodoConstantArray(QQ::Clause(QQ::OrderBy(QQN::QcodoConstant()->Variable->Name), QQ::Expand(QQN::QcodoConstant()->Variable)));
 }
开发者ID:qcodo,项目名称:qcodo-api,代码行数:9,代码来源:ConstantPanel.class.php

示例5: __construct

 public function __construct($objParentObject, $strSetEditPanelMethod, $strCloseEditPanelMethod, $strControlId = null)
 {
     // Call the Parent
     try {
         parent::__construct($objParentObject, $strControlId);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     // Record Method Callbacks
     $this->strSetEditPanelMethod = $strSetEditPanelMethod;
     $this->strCloseEditPanelMethod = $strCloseEditPanelMethod;
     // Setup DataGrid Columns
     $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_CONTROL->ParentControl->dtgQcodoConstant_EditLinkColumn_Render($_ITEM) ?>');
     $this->colEditLinkColumn->HtmlEntities = false;
     $this->colId = new QDataGridColumn(QApplication::Translate('Id'), '<?= $_ITEM->Id; ?>', array('OrderByClause' => QQ::OrderBy(QQN::QcodoConstant()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::QcodoConstant()->Id, false)));
     $this->colQcodoClassId = new QDataGridColumn(QApplication::Translate('Qcodo Class Id'), '<?= $_CONTROL->ParentControl->dtgQcodoConstant_QcodoClass_Render($_ITEM); ?>');
     $this->colVariableId = new QDataGridColumn(QApplication::Translate('Variable Id'), '<?= $_CONTROL->ParentControl->dtgQcodoConstant_Variable_Render($_ITEM); ?>');
     $this->colFileId = new QDataGridColumn(QApplication::Translate('File Id'), '<?= $_CONTROL->ParentControl->dtgQcodoConstant_File_Render($_ITEM); ?>');
     // Setup DataGrid
     $this->dtgQcodoConstant = new QDataGrid($this);
     $this->dtgQcodoConstant->CellSpacing = 0;
     $this->dtgQcodoConstant->CellPadding = 4;
     $this->dtgQcodoConstant->BorderStyle = QBorderStyle::Solid;
     $this->dtgQcodoConstant->BorderWidth = 1;
     $this->dtgQcodoConstant->GridLines = QGridLines::Both;
     // Datagrid Paginator
     $this->dtgQcodoConstant->Paginator = new QPaginator($this->dtgQcodoConstant);
     $this->dtgQcodoConstant->ItemsPerPage = 10;
     // Specify Whether or Not to Refresh using Ajax
     $this->dtgQcodoConstant->UseAjax = true;
     // Specify the local databind method this datagrid will use
     $this->dtgQcodoConstant->SetDataBinder('dtgQcodoConstant_Bind', $this);
     $this->dtgQcodoConstant->AddColumn($this->colEditLinkColumn);
     $this->dtgQcodoConstant->AddColumn($this->colId);
     $this->dtgQcodoConstant->AddColumn($this->colQcodoClassId);
     $this->dtgQcodoConstant->AddColumn($this->colVariableId);
     $this->dtgQcodoConstant->AddColumn($this->colFileId);
     // Setup the Create New button
     $this->btnCreateNew = new QButton($this);
     $this->btnCreateNew->Text = QApplication::Translate('Create a New') . ' ' . QApplication::Translate('QcodoConstant');
     $this->btnCreateNew->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCreateNew_Click'));
 }
开发者ID:qcodo,项目名称:qcodo-api,代码行数:43,代码来源:QcodoConstantListPanelBase.class.php

示例6: ProcessFolder

 protected function ProcessFolder($strFolder)
 {
     $strLabel = substr($strFolder, strlen($this->strRoot) + 1);
     if (!$strLabel) {
         $strLabel = 'root';
     }
     print 'Processing ' . $strLabel . ' [';
     $strFileArray = array();
     $strFolderArray = array();
     // Iterate through all subfolders and files in this folder
     // Be sure not to process anything with CVS, SVN or ds_store
     $objDirectory = opendir($strFolder);
     while ($strName = readdir($objDirectory)) {
         if ($strName != '.' && $strName != '..' && $strName != 'SVN' && $strName != '.svnignore' && $strName != 'CVS' && $strName != '.cvsignore' && strtolower($strName) != '.ds_store') {
             $strFullPath = $strFolder . '/' . $strName;
             if (is_dir($strFullPath)) {
                 array_push($strFolderArray, $strFullPath);
             } else {
                 array_push($strFileArray, $strFullPath);
             }
         }
     }
     $intFileCount = count($strFileArray);
     for ($intFileIndex = 0; $intFileIndex < $intFileCount; $intFileIndex++) {
         print ' ';
     }
     print ']';
     for ($intFileIndex = 0; $intFileIndex <= $intFileCount; $intFileIndex++) {
         print chr(8);
     }
     foreach ($strFileArray as $strFile) {
         print 'X';
         $strMd5 = md5_file($strFile);
         $strFullPath = $strFile;
         $strFile = substr($strFile, strlen($this->strRoot) + 1);
         // Process all files other than the root _README.txt and LICENSE.txt
         if ($strFile != '_README.txt' && $strFile != '_LICENSE.txt') {
             $intDirectoryId = null;
             $objFileDirectory = null;
             foreach ($this->objDirectoryTokens as $objDirectory) {
                 if (!$intDirectoryId) {
                     if (strpos($strFile, $objDirectory->Path) === 0) {
                         $intDirectoryId = $objDirectory->Id;
                         $objFileDirectory = $objDirectory;
                         $strFile = substr($strFile, strlen($objDirectory->Path));
                     }
                 }
             }
             if (!$intDirectoryId) {
                 var_dump($this->objDirectoryTokens);
                 exit("FATAL ERROR: No DirectoryToken resolution for " . $strFile . "\r\n");
             }
             $objFile = File::LoadByDirectoryIdPath($intDirectoryId, $strFile);
             if (!$objFile) {
                 $objFile = new File();
                 $objFile->Path = $strFile;
                 $objFile->DirectoryId = $intDirectoryId;
             } else {
                 $objFile->DeprecatedMajorVersion = null;
                 $objFile->DeprecatedMinorVersion = null;
                 $objFile->DeprecatedBuild = null;
             }
             $objFile->Save();
             $this->blnFileProcessedArray['id' . $objFile->Id] = true;
             $this->strXml .= sprintf("<file directoryToken=\"%s\" path=\"%s\" md5=\"%s\"/>\r\n", $objFileDirectory->Token, $strFile, $strMd5);
             // Parse tokens for documetation for all PHP files outside of assets and PHPUnit
             if (substr($strFile, strlen($strFile) - 4) == '.php' && strpos($strFullPath, '/assets/') === false && strpos($strFullPath, '/PHPUnit/') === false) {
                 switch ($objFileDirectory->Token) {
                     case '__INCLUDES__':
                     case '__QCODO__':
                     case '__QCODO_CORE__':
                         $objParser = new QScriptParser($strFullPath);
                         $objResult = $objParser->ParseTokens();
                         // Iterate through the Class Definitions
                         foreach ($objResult->ClassArray as $objParserClass) {
                             if ($objParserClass->Extends) {
                                 $objParentClass = QcodoClass::RestoreByName($objParserClass->Extends, $this->strVersion, null);
                             } else {
                                 $objParentClass = null;
                             }
                             // TO DO
                             // if ($strImplements) {
                             // }
                             $objClass = QcodoClass::RestoreByName($objParserClass->Name, $this->strVersion, $objFile);
                             $objClass->AbstractFlag = $objParserClass->Abstract;
                             $objClass->ParentQcodoClass = $objParentClass;
                             $objClass->Save();
                             // Class Constants
                             $strConstantArray = array();
                             foreach ($objParserClass->ConstantArray as $objParserConstant) {
                                 $objConstant = QcodoConstant::RestoreByNameForClass($objParserConstant->Name, $objClass->Id, $this->strVersion, $objFile);
                                 //										$strValue = QBuildMaker::StripQuotes($objParserConstant->Value);
                                 $strValue = $objParserConstant->Value;
                                 $objConstant->Variable->DefaultValue = $strValue;
                                 $objConstant->Variable->Save();
                                 $strConstantArray[$objParserConstant->Name] = true;
                             }
                             // Class Constants (Deprecate)
                             foreach ($objClass->GetQcodoConstantArray(QQ::Clause(QQ::Expand(QQN::QcodoConstant()->Variable))) as $objConstant) {
                                 if (!array_key_exists($objConstant->Variable->Name, $strConstantArray)) {
//.........这里部分代码省略.........
开发者ID:qcodo,项目名称:qcodo-api,代码行数:101,代码来源:QBuildMaker.class.php

示例7: CountByFileId

 /**
  * Count QcodoConstants
  * by FileId Index(es)
  * @param integer $intFileId
  * @return int
  */
 public static function CountByFileId($intFileId)
 {
     // Call QcodoConstant::QueryCount to perform the CountByFileId query
     return QcodoConstant::QueryCount(QQ::Equal(QQN::QcodoConstant()->FileId, $intFileId));
 }
开发者ID:qcodo,项目名称:qcodo-api,代码行数:11,代码来源:QcodoConstantGen.class.php


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