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


PHP Domain::setType方法代码示例

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


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

示例1: executeAdd

 /**
  * Add
  */
 public function executeAdd()
 {
     if ($this->isGET()) {
         return $this->renderJson(array("success" => false, "info" => "POST only."));
     } else {
         $name = $this->getRequestParameter('name');
         $domain = new Domain();
         $domain->setName($name);
         $domain->setType($this->template->getType());
         $domain->save();
         foreach ($this->template->getTemplateRecords() as $tr) {
             $record = new Record();
             $record->setDomainId($domain->getId());
             $record->setName(str_replace("%DOMAIN%", $name, $tr->getName()));
             $record->setType($tr->getType());
             if ($tr->getType() == 'SOA') {
                 $content = str_replace("%DOMAIN%", $name, $tr->getContent());
                 $content = str_replace("%SERIAL%", date("Ymd") . "01", $content);
             } else {
                 $content = $tr->getContent();
             }
             $record->setContent($content);
             $record->setTtl($tr->getTtl());
             $record->setPrio($tr->getPrio());
             $record->save();
         }
         return $this->renderJson(array("success" => true, "info" => "Domain added."));
     }
 }
开发者ID:royalterra,项目名称:pdns-gui,代码行数:32,代码来源:actions.class.php

示例2: setTypeFromString

 /**
  * Set the column type from a string property
  * (normally a string from an sql input file)
  *
  * @deprecated Do not use; this will be removed in next release.
  */
 public function setTypeFromString($typeName, $size)
 {
     $tn = strtoupper($typeName);
     $this->setType($tn);
     if ($size !== null) {
         $this->size = $size;
     }
     if (strpos($tn, "CHAR") !== false) {
         $this->domain->setType(PropelTypes::VARCHAR);
     } elseif (strpos($tn, "INT") !== false) {
         $this->domain->setType(PropelTypes::INTEGER);
     } elseif (strpos($tn, "FLOAT") !== false) {
         $this->domain->setType(PropelTypes::FLOAT);
     } elseif (strpos($tn, "DATE") !== false) {
         $this->domain->setType(PropelTypes::DATE);
     } elseif (strpos($tn, "TIME") !== false) {
         $this->domain->setType(PropelTypes::TIMESTAMP);
     } elseif (strpos($tn, "BINARY") !== false) {
         $this->domain->setType(PropelTypes::LONGVARBINARY);
     } else {
         $this->domain->setType(PropelTypes::VARCHAR);
     }
 }
开发者ID:rozwell,项目名称:Propel,代码行数:29,代码来源:Column.php


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