本文整理汇总了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>
示例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."));
}
}
示例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;
}