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


PHP Graph::findAll方法代码示例

本文整理汇总了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;
 }
开发者ID:nagyist,项目名称:Tattle,代码行数:23,代码来源:Dashboard.php

示例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);
        ?>
开发者ID:nagyist,项目名称:Tattle,代码行数:31,代码来源:list_filtered_dashboards.php

示例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);
                        }
开发者ID:nagyist,项目名称:Tattle,代码行数:31,代码来源:graphs.php


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