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


PHP PhabricatorLiskDAO::setDetail方法代码示例

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


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

示例1: applyCustomInternalTransaction

 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case HarbormasterBuildStepTransaction::TYPE_CREATE:
             return;
         case HarbormasterBuildStepTransaction::TYPE_NAME:
             return $object->setName($xaction->getNewValue());
         case HarbormasterBuildStepTransaction::TYPE_DEPENDS_ON:
             return $object->setDetail('dependsOn', $xaction->getNewValue());
         case HarbormasterBuildStepTransaction::TYPE_DESCRIPTION:
             return $object->setDescription($xaction->getNewValue());
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
开发者ID:pugong,项目名称:phabricator,代码行数:14,代码来源:HarbormasterBuildStepEditor.php

示例2: applyFinalEffects

 protected function applyFinalEffects(PhabricatorLiskDAO $object, array $xactions)
 {
     // If the repository does not have a local path yet, assign it one based
     // on its ID. We can't do this earlier because we won't have an ID yet.
     $local_path = $object->getDetail('local-path');
     if (!strlen($local_path)) {
         $local_key = 'repository.default-local-path';
         $local_root = PhabricatorEnv::getEnvConfig($local_key);
         $local_root = rtrim($local_root, '/');
         $id = $object->getID();
         $local_path = "{$local_root}/{$id}/";
         $object->setDetail('local-path', $local_path);
         $object->save();
     }
     return $xactions;
 }
开发者ID:Houzz,项目名称:phabricator,代码行数:16,代码来源:PhabricatorRepositoryEditor.php

示例3: applyCustomInternalTransaction

 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhabricatorRepositoryTransaction::TYPE_VCS:
             $object->setVersionControlSystem($xaction->getNewValue());
             break;
         case PhabricatorRepositoryTransaction::TYPE_ACTIVATE:
             $object->setDetail('tracking-enabled', $xaction->getNewValue());
             break;
         case PhabricatorRepositoryTransaction::TYPE_NAME:
             $object->setName($xaction->getNewValue());
             break;
         case PhabricatorRepositoryTransaction::TYPE_DESCRIPTION:
             $object->setDetail('description', $xaction->getNewValue());
             break;
         case PhabricatorRepositoryTransaction::TYPE_DEFAULT_BRANCH:
             $object->setDetail('default-branch', $xaction->getNewValue());
             break;
         case PhabricatorRepositoryTransaction::TYPE_TRACK_ONLY:
             $object->setDetail('branch-filter', array_fill_keys($xaction->getNewValue(), true));
             break;
         case PhabricatorRepositoryTransaction::TYPE_AUTOCLOSE_ONLY:
             $object->setDetail('close-commits-filter', array_fill_keys($xaction->getNewValue(), true));
             break;
         case PhabricatorRepositoryTransaction::TYPE_UUID:
             $object->setUUID($xaction->getNewValue());
             break;
         case PhabricatorRepositoryTransaction::TYPE_SVN_SUBPATH:
             $object->setDetail('svn-subpath', $xaction->getNewValue());
             break;
         case PhabricatorRepositoryTransaction::TYPE_NOTIFY:
             $object->setDetail('herald-disabled', (int) (!$xaction->getNewValue()));
             break;
         case PhabricatorRepositoryTransaction::TYPE_AUTOCLOSE:
             $object->setDetail('disable-autoclose', (int) (!$xaction->getNewValue()));
             break;
         case PhabricatorRepositoryTransaction::TYPE_REMOTE_URI:
             $object->setDetail('remote-uri', $xaction->getNewValue());
             break;
         case PhabricatorRepositoryTransaction::TYPE_LOCAL_PATH:
             $object->setDetail('local-path', $xaction->getNewValue());
             break;
         case PhabricatorRepositoryTransaction::TYPE_HOSTING:
             return $object->setHosted($xaction->getNewValue());
         case PhabricatorRepositoryTransaction::TYPE_PROTOCOL_HTTP:
             return $object->setServeOverHTTP($xaction->getNewValue());
         case PhabricatorRepositoryTransaction::TYPE_PROTOCOL_SSH:
             return $object->setServeOverSSH($xaction->getNewValue());
         case PhabricatorRepositoryTransaction::TYPE_PUSH_POLICY:
             return $object->setPushPolicy($xaction->getNewValue());
         case PhabricatorRepositoryTransaction::TYPE_CREDENTIAL:
             return $object->setCredentialPHID($xaction->getNewValue());
         case PhabricatorRepositoryTransaction::TYPE_DANGEROUS:
             $object->setDetail('allow-dangerous-changes', $xaction->getNewValue());
             return;
         case PhabricatorRepositoryTransaction::TYPE_SLUG:
             $object->setRepositorySlug($xaction->getNewValue());
             return;
         case PhabricatorRepositoryTransaction::TYPE_SERVICE:
             $object->setAlmanacServicePHID($xaction->getNewValue());
             return;
         case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_LANGUAGE:
             $object->setDetail('symbol-languages', $xaction->getNewValue());
             return;
         case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_SOURCES:
             $object->setDetail('symbol-sources', $xaction->getNewValue());
             return;
         case PhabricatorRepositoryTransaction::TYPE_STAGING_URI:
             $object->setDetail('staging-uri', $xaction->getNewValue());
             return;
         case PhabricatorRepositoryTransaction::TYPE_AUTOMATION_BLUEPRINTS:
             $object->setDetail('automation.blueprintPHIDs', $xaction->getNewValue());
             return;
         case PhabricatorRepositoryTransaction::TYPE_ENCODING:
             // Make sure the encoding is valid by converting to UTF-8. This tests
             // that the user has mbstring installed, and also that they didn't type
             // a garbage encoding name. Note that we're converting from UTF-8 to
             // the target encoding, because mbstring is fine with converting from
             // a nonsense encoding.
             $encoding = $xaction->getNewValue();
             if (strlen($encoding)) {
                 try {
                     phutil_utf8_convert('.', $encoding, 'UTF-8');
                 } catch (Exception $ex) {
                     throw new PhutilProxyException(pht("Error setting repository encoding '%s': %s'", $encoding, $ex->getMessage()), $ex);
                 }
             }
             $object->setDetail('encoding', $encoding);
             break;
     }
 }
开发者ID:nanamiwang,项目名称:phabricator,代码行数:91,代码来源:PhabricatorRepositoryEditor.php

示例4: applyCustomInternalTransaction

 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhabricatorRepositoryTransaction::TYPE_VCS:
             $object->setVersionControlSystem($xaction->getNewValue());
             break;
         case PhabricatorRepositoryTransaction::TYPE_ACTIVATE:
             $active = $xaction->getNewValue();
             // The first time a repository is activated, clear the "new repository"
             // flag so we stop showing setup hints.
             if ($active) {
                 $object->setDetail('newly-initialized', false);
             }
             $object->setDetail('tracking-enabled', $active);
             break;
         case PhabricatorRepositoryTransaction::TYPE_NAME:
             $object->setName($xaction->getNewValue());
             break;
         case PhabricatorRepositoryTransaction::TYPE_DESCRIPTION:
             $object->setDetail('description', $xaction->getNewValue());
             break;
         case PhabricatorRepositoryTransaction::TYPE_DEFAULT_BRANCH:
             $object->setDetail('default-branch', $xaction->getNewValue());
             break;
         case PhabricatorRepositoryTransaction::TYPE_TRACK_ONLY:
             $object->setDetail('branch-filter', array_fill_keys($xaction->getNewValue(), true));
             break;
         case PhabricatorRepositoryTransaction::TYPE_AUTOCLOSE_ONLY:
             $object->setDetail('close-commits-filter', array_fill_keys($xaction->getNewValue(), true));
             break;
         case PhabricatorRepositoryTransaction::TYPE_UUID:
             $object->setUUID($xaction->getNewValue());
             break;
         case PhabricatorRepositoryTransaction::TYPE_SVN_SUBPATH:
             $object->setDetail('svn-subpath', $xaction->getNewValue());
             break;
         case PhabricatorRepositoryTransaction::TYPE_NOTIFY:
             $object->setDetail('herald-disabled', (int) (!$xaction->getNewValue()));
             break;
         case PhabricatorRepositoryTransaction::TYPE_AUTOCLOSE:
             $object->setDetail('disable-autoclose', (int) (!$xaction->getNewValue()));
             break;
         case PhabricatorRepositoryTransaction::TYPE_PUSH_POLICY:
             return $object->setPushPolicy($xaction->getNewValue());
         case PhabricatorRepositoryTransaction::TYPE_DANGEROUS:
             $object->setDetail('allow-dangerous-changes', $xaction->getNewValue());
             return;
         case PhabricatorRepositoryTransaction::TYPE_SLUG:
             $object->setRepositorySlug($xaction->getNewValue());
             return;
         case PhabricatorRepositoryTransaction::TYPE_SERVICE:
             $object->setAlmanacServicePHID($xaction->getNewValue());
             return;
         case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_LANGUAGE:
             $object->setDetail('symbol-languages', $xaction->getNewValue());
             return;
         case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_SOURCES:
             $object->setDetail('symbol-sources', $xaction->getNewValue());
             return;
         case PhabricatorRepositoryTransaction::TYPE_STAGING_URI:
             $object->setDetail('staging-uri', $xaction->getNewValue());
             return;
         case PhabricatorRepositoryTransaction::TYPE_AUTOMATION_BLUEPRINTS:
             $object->setDetail('automation.blueprintPHIDs', $xaction->getNewValue());
             return;
         case PhabricatorRepositoryTransaction::TYPE_CALLSIGN:
             $object->setCallsign($xaction->getNewValue());
             return;
         case PhabricatorRepositoryTransaction::TYPE_ENCODING:
             $object->setDetail('encoding', $xaction->getNewValue());
             break;
     }
 }
开发者ID:rchicoli,项目名称:phabricator,代码行数:73,代码来源:PhabricatorRepositoryEditor.php


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