本文整理汇总了PHP中Graph::findAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Graph::findAll方法的具体用法?PHP Graph::findAll怎么用?PHP Graph::findAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graph
的用法示例。
在下文中一共展示了Graph::findAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: export_in_json
public function export_in_json()
{
$dashboard_id = $this->getDashboardId();
$json_env = parent::export_in_json();
// Find all the lines of this graph
$graphs = Graph::findAll($dashboard_id);
$json_graphs_array = array();
foreach ($graphs as $graph_in_dashboard) {
// Export them in JSON
$json_graphs_array[] = $graph_in_dashboard->export_in_json();
}
// Implode them
$json_graph = "\"graphs\":[";
if (!empty($json_graphs_array)) {
$json_graph .= implode(",", $json_graphs_array);
}
$json_graph .= "]";
// Replace the last } of the json
$json_env[strlen($json_env) - 1] = ",";
// Concat the graph with its lines
$json_env .= $json_graph . "}";
return $json_env;
}
示例2: deselectAll
deselectAll();
return false;" /></th>
</tr>
</thead>
<tbody>
<?php
$first = TRUE;
if ($filter_group_id == -1) {
$dashboards = Dashboard::findAll();
} else {
$dashboards = Dashboard::findAllByFilter($filter_group_id);
}
/* Filter Graphs */
foreach ($dashboards as $dashboard) {
$dashboard_id = $dashboard->getDashboardId();
$graphs = Graph::findAll($dashboard_id);
$number_of_lines = 0;
foreach ($graphs as $graph) {
$number_of_lines = $number_of_lines + Line::countAllByFilter($graph->getGraphId(), $filter_text);
}
$number_of_graphs = Graph::countAllByFilter($dashboard_id, $filter_text);
?>
<?php
if ($number_of_graphs > 0 || $number_of_lines > 0 || preg_match('/' . $filter_text . '/i', $dashboard->getName()) || preg_match('/' . $filter_text . '/i', $dashboard->getDescription())) {
?>
<tr>
<td class="name">
<a href="<?php
echo Dashboard::makeURL('view', $dashboard);
?>
示例3: catch
fMessaging::create('success', "/" . $url_redirect, 'The Graph "' . $graph_to_clone->getName() . '" was successfully cloned into the Dashboard "' . $dashboard->getName() . '"');
fURL::redirect($url_redirect);
} catch (fExpectedException $e) {
fMessaging::create('error', fURL::get(), $e->getMessage());
}
}
include VIEW_PATH . '/list_dashboards.php';
} elseif ('reorder' == $action) {
$drag_order = fRequest::get('drag_order');
$error = false;
if (empty($drag_order)) {
// In this case, the user clicks on the arrow
$move = fRequest::getValid('move', array('previous', 'next'));
$graph_to_move = new Graph($graph_id);
$dashboard_id = $graph_to_move->getDashboardId();
$graphs_in_dashboard = Graph::findAll($dashboard_id);
$number_of_graphs = $graphs_in_dashboard->count(TRUE);
$skip_next = false;
for ($i = 0; $i < $number_of_graphs; $i++) {
if (!$skip_next) {
$current_graph = $graphs_in_dashboard[$i];
if ($current_graph->getGraphId() != $graph_id) {
// This isn't the concerned graph
$current_graph->setWeight($i);
} else {
if ('previous' == $move) {
if ($i > 0) {
$current_graph->setWeight($i - 1);
$previous_graph = $graphs_in_dashboard[$i - 1];
$previous_graph->setWeight($i);
}