本文整理汇总了PHP中Channel::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP Channel::fetch方法的具体用法?PHP Channel::fetch怎么用?PHP Channel::fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Channel
的用法示例。
在下文中一共展示了Channel::fetch方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: p
p($info['name']);
?>
</strong>
<div class="right"><a href="?page=contact&id=<?php
p($contact->getId());
?>
">Edit</a> - <a
href="?page=contact-delete&id=<?php
p($contact->getId());
?>
">Delete</a></div>
</div>
<ul class="information">
<?php
foreach ($info['channels'] as $chan) {
$chandle = Channel::fetch(intval($chan['id']));
?>
<li>
<?php
p($chandle->getName());
?>
<div class="descr"><?php
p($chandle);
?>
</div>
</li>
<?php
}
?>
</ul>
<?php
示例2: processAddEdit
public function processAddEdit($data)
{
$errors = array();
if (strlen($data['hostname']) == 0) {
$errors['hostname'] = 'Hostname cannot be blank.';
}
$this->hostname = $data['hostname'];
if (!is_numeric($data['port'])) {
$errors['port'] = 'Port must be numeric.';
}
$this->port = intval($data['port']);
$this->alias = $data['alias'];
if (!is_numeric($data['fail_threshold']) || intval($data['fail_threshold']) <= 0) {
$errors['fail_threshold'] = 'Failure threshold must be a positive integer.';
}
$this->fail_threshold = intval($data['fail_threshold']);
$this->notification_channels = array();
if (is_array($data['notification_channels'])) {
foreach ($data['notification_channels'] as $id) {
$this->notification_channels[] = Channel::fetch(intval($id));
}
}
$this->status = intval($data['status']);
if ($this->status == STATUS_DOWNTIME) {
if (!is_numeric($data['downtime_start_hours']) || !is_numeric($data['downtime_start_minutes']) || !is_numeric($data['downtime_end_hours']) || !is_numeric($data['downtime_end_minutes'])) {
$errors['interval'] = 'Invalid time or interval.';
}
$this->downtime_start = time() + intval($data['downtime_start_hours']) * 60 + intval($data['downtime_start_minutes']);
$this->downtime_end = time() + intval($data['downtime_end_hours']) * 60 + intval($data['downtime_end_minutes']);
} else {
$this->downtime_start = 0;
$this->downtime_end = 0;
}
$errors = $this->customProcessAddEdit($data, $errors);
return $errors;
}
示例3: p
<?php
$channel = Channel::fetch(intval($_GET['id']));
$owner = $channel->getOwner();
if (FormHelpers::donePOST()) {
$channel->processDelete($_GET);
?>
<div class="message">
The channel has been deleted. <br />
<a href="?page=contact&id=<?php
p($owner);
?>
">Return to contact</a>
</div>
<?php
} else {
?>
<div class="form-field">
</div>
<?php
FormHelpers::startForm('POST', '?page=channel-delete&id=' . $channel->getId());
FormHelpers::createHidden('confirmed', '1');
?>
<center>
Are you sure you want to delete this channel?<br />
<?php
FormHelpers::createSubmit('Yes');
?>
</center>
<?php
FormHelpers::endForm();
示例4: processDelete
public function processDelete($data)
{
$chans = $GLOBALS['PW_DB']->executeSelect('id', 'channels', 'WHERE owner=' . intval($data['id']));
foreach ($chans as $chan) {
$channel = Channel::fetch($chan);
$channel->processDelete();
}
$GLOBALS['PW_DB']->executeDelete('contacts', 'WHERE id=' . intval($data['id']));
}