當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PhabricatorLiskDAO::setVisibility方法代碼示例

本文整理匯總了PHP中PhabricatorLiskDAO::setVisibility方法的典型用法代碼示例。如果您正苦於以下問題:PHP PhabricatorLiskDAO::setVisibility方法的具體用法?PHP PhabricatorLiskDAO::setVisibility怎麽用?PHP PhabricatorLiskDAO::setVisibility使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PhabricatorLiskDAO的用法示例。


在下文中一共展示了PhabricatorLiskDAO::setVisibility方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: applyCustomInternalTransaction

 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhamePostTransaction::TYPE_TITLE:
             return $object->setTitle($xaction->getNewValue());
         case PhamePostTransaction::TYPE_SUBTITLE:
             return $object->setSubtitle($xaction->getNewValue());
         case PhamePostTransaction::TYPE_BODY:
             return $object->setBody($xaction->getNewValue());
         case PhamePostTransaction::TYPE_BLOG:
             return $object->setBlogPHID($xaction->getNewValue());
         case PhamePostTransaction::TYPE_HEADERIMAGE:
             return $object->setHeaderImagePHID($xaction->getNewValue());
         case PhamePostTransaction::TYPE_VISIBILITY:
             if ($xaction->getNewValue() == PhameConstants::VISIBILITY_DRAFT) {
                 $object->setDatePublished(0);
             } else {
                 if ($xaction->getNewValue() == PhameConstants::VISIBILITY_ARCHIVED) {
                     $object->setDatePublished(0);
                 } else {
                     $object->setDatePublished(PhabricatorTime::getNow());
                 }
             }
             return $object->setVisibility($xaction->getNewValue());
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
開發者ID:NeoArmageddon,項目名稱:phabricator,代碼行數:27,代碼來源:PhamePostEditor.php

示例2: applyCustomInternalTransaction

 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhabricatorProfilePanelConfigurationTransaction::TYPE_PROPERTY:
             $key = $xaction->getMetadataValue('property.key');
             $value = $xaction->getNewValue();
             $object->setPanelProperty($key, $value);
             return;
         case PhabricatorProfilePanelConfigurationTransaction::TYPE_ORDER:
             $object->setPanelOrder($xaction->getNewValue());
             return;
         case PhabricatorProfilePanelConfigurationTransaction::TYPE_VISIBILITY:
             $object->setVisibility($xaction->getNewValue());
             return;
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
開發者ID:truSense,項目名稱:phabricator,代碼行數:17,代碼來源:PhabricatorProfilePanelEditor.php

示例3: applyCustomInternalTransaction

 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhamePostTransaction::TYPE_TITLE:
             return $object->setTitle($xaction->getNewValue());
         case PhamePostTransaction::TYPE_PHAME_TITLE:
             return $object->setPhameTitle($xaction->getNewValue());
         case PhamePostTransaction::TYPE_BODY:
             return $object->setBody($xaction->getNewValue());
         case PhamePostTransaction::TYPE_VISIBILITY:
             if ($xaction->getNewValue() == PhameConstants::VISIBILITY_DRAFT) {
                 $object->setDatePublished(0);
             } else {
                 $object->setDatePublished(PhabricatorTime::getNow());
             }
             return $object->setVisibility($xaction->getNewValue());
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
開發者ID:patelhardik,項目名稱:phabricator,代碼行數:19,代碼來源:PhamePostEditor.php


注:本文中的PhabricatorLiskDAO::setVisibility方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。