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


PHP Record::setName方法代码示例

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


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

示例1: Record

	<p>
		<label for="title">Title:</label>
		<input type="text" name="title" id="title">
	</p>
	<p>
		<label for="description">Description:</label>
		<textarea name="description" id="description"></textarea>
	</p>
	<p>
		<input type="submit" name="send" id="send" value="Send">
	</p>
</form>


<pre>
	
	<?php 
require_once 'Record.php';
if (isset($_POST['name']) && $_POST['name'] != '') {
    $myRecord = new Record();
    $myRecord->setName($_POST['name']);
    echo "The name of this record  is: ";
    $myRecord->getName();
} else {
    echo "Please enter the name of your record!";
}
?>
</pre>

</body>
</html>
开发者ID:silviaperez,项目名称:dig540,代码行数:31,代码来源:index.php

示例2: executeEdit

 /**
  * Edit
  */
 public function executeEdit()
 {
     if ($this->isGET()) {
         return $this->renderJson(array("success" => false, "info" => "POST only."));
     } else {
         $ids = array();
         foreach ($this->getRequestParameter('record') as $data) {
             if (!($record = RecordPeer::retrieveByPK($data['id']))) {
                 $record = new Record();
                 $record->setDomainId($this->domain->getId());
             }
             $record->setName($data['name']);
             $record->setType($data['type']);
             $record->setContent($data['content']);
             $record->setTtl($data['ttl']);
             if ($data['type'] == 'MX' || $data['type'] == 'SRV') {
                 $record->setPrio($data['prio']);
             }
             $record->save();
             $ids[] = $record->getId();
         }
         $c = new Criteria();
         $c->add(RecordPeer::DOMAIN_ID, $this->domain->getId());
         $c->add(RecordPeer::ID, $ids, Criteria::NOT_IN);
         foreach (RecordPeer::doSelect($c) as $record) {
             $record->delete();
         }
         return $this->renderJson(array("success" => true, "info" => "Domain updated."));
     }
 }
开发者ID:royalterra,项目名称:pdns-gui,代码行数:33,代码来源:actions.class.php

示例3: createFromArray

 /**
  * Create Record instance from array.
  *
  * @param array $array
  *
  * @return Record
  */
 public static function createFromArray($array)
 {
     $r = new Record();
     $r->setId($array['id']);
     $r->setName($array['name']);
     $r->setContent($array['content']);
     $r->setTtl($array['ttl']);
     $r->setType($array['type']);
     $r->setPriority($array['priority']);
     $r->setDomainId($array['domain_id']);
     $r->setGeoRegionId($array['geo_region_id']);
     $r->setGeoLock($array['geo_lock']);
     $r->setGeoLong($array['geo_long']);
     $r->setGeoLat($array['geo_lat']);
     $r->setFailoverEnabled($array['failover_enabled']);
     $r->setFailoverContent($array['failover_content']);
     $r->setFailoverWithdraw($array['failover_withdraw']);
     $r->setActive($array['is_active']);
     $r->setUdpLimit($array['udp_limit']);
     return $r;
 }
开发者ID:haphan,项目名称:php-rage4dns,代码行数:28,代码来源:Record.php


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