本文整理汇总了PHP中Domain::get_all方法的典型用法代码示例。如果您正苦于以下问题:PHP Domain::get_all方法的具体用法?PHP Domain::get_all怎么用?PHP Domain::get_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Domain
的用法示例。
在下文中一共展示了Domain::get_all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
document.observe("dom:loaded", function() { Form.focusFirstElement($('queryForm')); });
</script>
Search through domains (name) and records (name/content). SQL 'LIKE' syntax supported: an underscore (_) in pattern matches any single character, a percent sign (%) matches any string of zero or more characters.<br><br>
<form method="GET" id="queryForm" name="queryForm">
<input type="text" name="query" value="<?php
echo isset($_GET['query']) ? $_GET['query'] : '';
?>
">
<input type="submit" name="submit" value="Search">
</form>
<?php
if ($_GET["query"]) {
$dFindResult = Domain::get_all(array('conditions' => 'd.name LIKE ' . Domain::quote($_GET['query'])));
if (is_array($dFindResult) && count($dFindResult) > 0) {
print '<h2>Domains (' . count($dFindResult) . ')</h2>';
print $display->domains_header();
foreach ($dFindResult as $domain) {
print $display->domain($domain);
}
print $display->domains_footer();
print '<br>';
}
flush();
$rFindResult = Record::find('all', array('conditions' => 'name LIKE ' . Record::quote($_GET['query']) . ' OR ' . 'content LIKE ' . Record::quote($_GET['query']), 'order' => 'name'));
if (is_array($rFindResult) && count($rFindResult) > 0) {
print '<h2>Records (' . count($rFindResult) . ')</h2>';
print $display->records_header();
foreach ($rFindResult as $record) {
示例2: record_count
public function record_count()
{
$result = Domain::get_all(array('conditions' => 'd.name=' . Domain::quote($this->name)));
return $result[0]['record_count'];
}