Fetch the tour data for the specified tour.

@param   int         $tourid         The ID of the tour to fetch steps for
517730
public static function get_stepdata($tourid) {
        global $DB;

        $cache = \cache::make('tool_usertours', self::CACHENAME_STEP);

        $data = $cache->get($tourid);
        if ($data === false) {
            $sql = <<<EOF
                SELECT s.*
                  FROM {tool_usertours_steps} s
                 WHERE s.tourid = :tourid
              ORDER BY s.sortorder ASC
EOF;

            $data = $DB->get_records_sql($sql, ['tourid' => $tourid]);
            $cache->set($tourid, $data);
        }

        return $data;
    }
612350
public function getRoute($coverageId, $routeId, $depth = 1)
    {
        $query = array(
            'api' => 'coverage',
            'parameters' => array(
                'region'      => $coverageId,
                'path_filter' => 'routes/'.$routeId,
                'parameters'  => '?depth='.$depth
            )
        );

        return $this->navitia_component->call($query);
    }
767924
public function sync($dirId)
    {
        $dir = $this->getDirOrFail($dirId);
        $this->fileDB->syncWithFs($dir, 1);
        return $this->redirectTo('index', [$dir->getId()]);
    }
836331
public function getDataBySiteIdAndPageId($siteId, $pageId)
	{
	    $select = $this->tableGateway->getSql()->select();
	     
	    $select->columns(array('*'));
	     
	    $select->where(array("s404_site_id" => $siteId, 's404_page_id' => $pageId));
	    $resultSet = $this->tableGateway->selectWith($select);
	     
	    return $resultSet;
	}
548603
public function getShowById($showId)
  {
    $response = $this->request('/GetShowById/' . $showId);
    if ( $response->response->status == 'false' )
      return null;
    $show     = $response->response;

    $show = $this->formatShow($show);

    return $show;
  }
844256
public function load($id = null)
    {
        if (!is_null($id)) {
            $this->setId($id);
        }

        $this->isLoaded = false;
        $data = $this->getDbGateway()->load($this->getId());
        if ($data) {
            $this->setData($data);
            $this->isLoaded = true;
        }

        return $this->isLoaded();
    }
649762
public static function get_tours() {
        global $DB;

        $tours = $DB->get_records('tool_usertours_tours', array(), 'sortorder ASC');
        $return = [];
        foreach ($tours as $tour) {
            $return[$tour->id] = tour::load_from_record($tour);
        }
        return $return;
    }
971580
protected function getTotal($VisitorsID)
	{
		$VisitorsTotalVisitCount = 0;
    	$VisitorsTotalHitCount   = 0;
	    if ($VisitorsID) 
	    {
    		//Total seit Zählung
    		$objVisitorsTotalCount = \Database::getInstance()
    		        ->prepare("SELECT 
                                    SUM(visitors_visit) AS SUMV, 
                                    SUM(visitors_hit) AS SUMH
                                FROM 
                                    tl_visitors_counter
                                WHERE 
                                    vid=?")
                    ->execute($VisitorsID);
    	    if ($objVisitorsTotalCount->numRows > 0) 
    	    {
    		    $objVisitorsTotalCount->next();
                $VisitorsTotalVisitCount = ($objVisitorsTotalCount->SUMV === null) ? 0 : $objVisitorsTotalCount->SUMV;
                $VisitorsTotalHitCount   = ($objVisitorsTotalCount->SUMH === null) ? 0 : $objVisitorsTotalCount->SUMH;
    	    }
	    }
	    return array('VisitorsTotalVisitCount' => $this->getFormattedNumber($VisitorsTotalVisitCount,0),
	                 'VisitorsTotalHitCount'   => $this->getFormattedNumber($VisitorsTotalHitCount,0)
	                );
	}
1070100
public function show($id, $cardId)
    {
        return $this->get($this->getPath($id).'/'.rawurlencode($cardId));
    }
548042
public function getGoal($id, $counterId)
    {
        $resource = 'counter/' . $counterId . '/goal/' . $id;
        $response = $this->sendGetRequest($resource);
        $goalResponse = new Models\GetGoalResponse($response);
        return $goalResponse->getGoal();
    }
359400
public static function get($routeTypeId)
    {
        if (!self::$_initialized) {
            self::_init();
        }

        $routeTypeId = (int)$routeTypeId;

        if (isset(self::$_routeTypes[$routeTypeId])) {
            return self::$_routeTypes[$routeTypeId];
        }

        return false;
    }
846093
public function getSourceSurveyId($surveyId) {
        $tracker = $this->loader->getTracker();
        $survey  = $tracker->getSurvey($surveyId);

        return $survey->getSourceSurveyId();
    }
1013358
public function loadById($productId)
    {
        return $this->productRepository->getById($productId, false, $this->storeManager->getStore()->getId(), true);
    }
16646
protected function view_tour($tourid) {
        global $PAGE;
        $tour = helper::get_tour($tourid);

        $PAGE->navbar->add($tour->get_name(), $tour->get_view_link());

        $this->header($tour->get_name());
        echo \html_writer::span(get_string('viewtour_info', 'tool_usertours', [
                'tourname'  => $tour->get_name(),
                'path'      => $tour->get_pathmatch(),
            ]));
        echo \html_writer::div(get_string('viewtour_edit', 'tool_usertours', [
                'editlink'  => $tour->get_edit_link()->out(),
                'resetlink' => $tour->get_reset_link()->out(),
            ]));

        $table = new table\step_list($tourid);
        foreach ($tour->get_steps() as $step) {
            $table->add_data_keyed($table->format_row($step));
        }

        $table->finish_output();
        $this->print_edit_step_link($tourid);

        // JS for Step management.
        $PAGE->requires->js_call_amd('tool_usertours/managesteps', 'setup');

        $this->footer();
    }
45870
protected function get_edit_tour_link($id = null) {
        $addlink = helper::get_edit_tour_link($id);
        return \html_writer::link($addlink, get_string('newtour', 'tool_usertours'));
    }
1069673
protected function reset_tour_for_all($tourid) {
        require_sesskey();

        $tour = tour::instance($tourid);
        $tour->mark_major_change();

        redirect(helper::get_view_tour_link($tourid), get_string('tour_resetforall', 'tool_usertours'));
    }
1303989
public function fetch ( $id ) {
        if (isset( self::$propData[$this->getKey( $id )] )) {
            return self::$propData[$this->getKey( $id )];
        }
        return false;
    }