Returns general bind parameters for all log aggregation queries. This includes the datetime
start of entities, datetime end of entities and IDs of all sites.

@return array
327592
public function getGeneralQueryBindParams()
    {
        $bind = array($this->dateStart->toString(Date::DATE_TIME_FORMAT), $this->dateEnd->toString(Date::DATE_TIME_FORMAT));
        $bind = array_merge($bind, $this->sites);

        return $bind;
    }
539743
private function buildQueries()
    {
        $queries = array();

        $outerGlue = $this->propelConfiguration->getParameter('debugpdo.logging.outerglue', ' | ');
        $innerGlue = $this->propelConfiguration->getParameter('debugpdo.logging.innerglue', ': ');

        foreach ($this->logger->getQueries() as $q) {
            $parts = explode($outerGlue, $q, 4);

            $times = explode($innerGlue, $parts[0]);
            $con = explode($innerGlue, $parts[2]);
            $memories = explode($innerGlue, $parts[1]);

            $sql = trim($parts[3]);
            $con = trim($con[1]);
            $time = trim($times[1]);
            $memory = trim($memories[1]);

            $queries[] = array('connection' => $con, 'sql' => $sql, 'time' => $time, 'memory' => $memory);
        }

        return $queries;
    }
1100564
protected function getDatabaseQueries()
    {
        $queries = [];
        foreach ($this->logger->queries as $query) {
            $queries[] = [
                'query'      => $this->formatter->format($this->connection->getDatabasePlatform(), $query['sql'], $query['params']),
                'duration'   => $query['executionMS'] * 1000,
                'connection' => $this->connection->getDriver()->getName()
            ];
        }

        return $queries;
    }
122563
public function callAggregateCoreMetrics()
    {
        $this->logAggregator->setQueryOriginHint('Core');

        if ($this->shouldAggregateFromRawData) {
            $metrics = $this->aggregateDayVisitsMetrics();
        } else {
            $metrics = $this->aggregateMultipleVisitsMetrics();
        }

        if (empty($metrics)) {
            return array(
                'nb_visits' => false,
                'nb_visits_converted' => false
            );
        }
        return array(
            'nb_visits' => $metrics['nb_visits'],
            'nb_visits_converted' => $metrics['nb_visits_converted']
        );
    }
270060
public function getBindValuesCOMMON()
    {
        $bind_values = $this->bind_values;
        $i           = 1;
        foreach ($this->bind_where as $val) {
            $bind_values[$i] = $val;
            $i++;
        }
        return $bind_values;
    }
964662
public function getAllDeathDates(): array
    {
        foreach (Gedcom::DEATH_EVENTS as $event) {
            $tmp = $this->getAllEventDates([$event]);
            if ($tmp) {
                return $tmp;
            }
        }

        return [];
    }
883228
public function findAllClosedQuery()
    {
        $qb = $this->createQueryBuilder('p');

        return $qb
            // Add conditions.
            ->andWhere($qb->expr()->orX(
                $qb->expr()->eq('p.active', ':active'),
                $qb->expr()->lte('p.expiry', ':now')
            ))

            // Add parameters.
            ->setParameter('active', false)
            ->setParameter('now', new \DateTime())

            // Order by and get results.
            ->orderBy('p.name', 'ASC')
            ->getQuery();
    }
264482
public function compileParameters(): array
    {
        $return = [
            'query' => [],
            'resource_id' => $this->resourceId,
        ];

        if ($this->filterBy) {
            $return['query']['filter_by'] = $this->filterBy;
        }

        if ($this->sortBy) {
            $return['query']['sort_by'] = $this->sortBy;
        }

        if ($this->fieldList) {
            $return['query']['field_list'] = $this->fieldList;
        }

        if ($this->parameters) {
            foreach ($this->parameters as $name => $value) {
                $return['query'][$name] = $value;
            }
        }

        return $return;
    }
960431
public function getParams()
    {
        $res = [];
        if ($this->_params instanceof Closure) {
            $res = call_user_func($this->_params, $this);
        } else {
            foreach ($this->_params as $k => $v) {
                $res[$k] = $v instanceof Closure ? call_user_func($v, $this, $this->getModel()) : $v;
            }
        }

        return array_merge($res, $this->prepareData($res));
    }
964967
protected static function getParams()
    {
        $adapter  = app(FilterAdapter::class)->add(ActivityTypeWidgetFilter::class);
        $request  = app('request');
        $priority = $request->get('priority');
        $search   = $request->get('search');
        $logs     = self::filter($priority, $search);
        return [
            'select_url'        => self::getBaseUrl(['page' => 1, 'per_page' => self::perPage, 'search' => '']),
            'search_url'        => self::getBaseUrl(['page' => 1, 'per_page' => self::perPage, 'priority' => null]),
            'url'               => self::getBaseUrl(),
            'selected_priority' => $priority,
            'search'            => $search,
            'types'             => app(LogTypes::class)->all(),
            'logs'              => $logs,
            'pagination'        => $logs->links('antares/foundation::layouts.antares.partials.pagination._pagination'),
            'priorites'         => app(LogPriorities::class)->all(),
            'filters'           => $adapter->getFilters('antares/logger::admin.widgets.log_filter')
        ];
    }
557504
protected function get_legacy_logdata() {
        if ($this->anonymous) {
            return null;
        } else {
            return array($this->courseid, 'feedback', 'submit', 'view.php?id=' . $this->other['cmid'],
                    $this->other['instanceid'], $this->other['cmid'], $this->relateduserid);
        }
    }
870885
public function prepareBindings( array $bindings )
	{
		$grammar = $this->getQueryGrammar();

		foreach( $bindings as $key => $value )
		{
			// We need to transform all instances of DateTimeInterface into the actual
			// date string. Each query grammar maintains its own date string format
			// so we'll just ask the grammar for the format to get from the date.
			if( $value instanceof DateTimeInterface )
			{
				$bindings[ $key ] = $value->format( $grammar->getDateTimeFormatString() );
			}
			else if( $value === false )
			{
				$bindings[ $key ] = 0;
			}
		}

		return $bindings;
	}
1000472
public function getParams()
    {
        //exit early if no types are set
        if (empty($this->types)) {
            return $this->params;
        }

        $params = [];
        $num_params = count($this->params);
        for ($i = 0; $i < $num_params; $i++) {
            $value = $this->params[$i];
            $column = $this->param_columns[$i];

            if (isset($this->types[$column])) {
                $params[] = $this->connection->convertToDatabaseValue($value, $this->types[$column]);
                continue;
            }
            $params[] = $value;
        }

        return $params;
    }
1340332
public function getProxyBindings()
	{
		if($this->proxyTypes === NULL)
		{
			$this->proxyTypes = [];
			
			foreach($this->bindings as $binding)
			{
				$scope = $binding->getScope();
		
				if($scope === NULL)
				{
					continue;
				}
		
				if(Singleton::class == $scope)
				{
					continue;
				}
		
				$this->proxyTypes[strtolower($binding->getTypeName())] = $binding;
			}
		}
		
		return $this->proxyTypes;
	}
597619
public function toArray()
    {
        $query = [
            'numericFilters' => '',
            'facetFilters'   => '',
        ];

        if ($this->query != '') {
            $query['query'] = $this->query;
        }

        if ($this->useLocationAwareSearch) {
            $query['aroundLatLng'] = $this->lat.','.$this->lng;
            $query['aroundRadius'] = $this->aroundRadius;
        }

        foreach ($this->dateRestrictions as $dateRestriction) {
            $query['numericFilters'] .= ','.
                $dateRestriction['dateFieldName'].
                $dateRestriction['operation'].
                $dateRestriction['date']->getTimeStamp();
        }

        foreach ($this->numericFilters as $filter) {
            $query['numericFilters'] .= ','.$filter;
        }

        foreach ($this->facets as $facet) {
            $query['facetFilters'] .= ','.$facet;
        }

        $query['page'] = $this->page;
        $query['hitsPerPage'] = $this->hitsPerPage;

        return $query;
    }
98070
public function getQueryContext(): ?array
    {
        $queryContext = $this->getConfiguration()->getOption('query_context');
        if ($queryContext && $this->getConfiguration()->getOption('use_global_context')) {
            $queryContext = array_merge($this->getFamily()->getContext(), (array) $queryContext);
        }

        return $queryContext;
    }
408174
public function buildQueries(\DateTime $start_date, \DateTime $end_date, $unit_ids) {
    $queries = array();

    $queries[Event::BAT_DAY] = 'SELECT * FROM ' . $this->day_table . ' WHERE ';
    $queries[Event::BAT_HOUR] = 'SELECT * FROM ' . $this->hour_table . ' WHERE ';
    $queries[Event::BAT_MINUTE] = 'SELECT * FROM ' . $this->minute_table . ' WHERE ';

    // Create a mock event which we will use to determine how to query the database
    $mock_event = new Event($start_date, $end_date, new Unit(0, 0, array()), -10);
    // We don't need a granular event even if we are retrieving granular data - since we don't
    // know what the event break-down is going to be we need to get the full range of data from
    // days, hours and minutes.
    $itemized = $mock_event->itemize(new EventItemizer($mock_event, Event::BAT_DAILY));

    $year_count = 0;

    $query_parameters = '';

    foreach ($itemized[Event::BAT_DAY] as $year => $months) {
      if ($year_count > 0) {
        // We are dealing with multiple years so add an OR
        $query_parameters .= ' OR ';
      }
      $query_parameters .= 'year IN (' . $year . ') ';
      $query_parameters .= 'AND month IN (' . implode(",", array_keys($months)) . ') ';
      if (count($unit_ids) > 0) {
        // Unit ids are defined so add this as a filter
        $query_parameters .= 'AND unit_id in (' . implode("," , $unit_ids) . ') ';
      }
      $year_count++;
    }

    // Add parameters to each query
    $queries[Event::BAT_DAY] .= $query_parameters;
    $queries[Event::BAT_HOUR] .= $query_parameters;
    $queries[Event::BAT_MINUTE] .= $query_parameters;

    // Clean up and add ordering information
    $queries[Event::BAT_DAY] .= ' ORDER BY unit_id, year, month';
    $queries[Event::BAT_HOUR] .= ' ORDER BY unit_id, year, month, day';
    $queries[Event::BAT_MINUTE] .= ' ORDER BY unit_id, year, month, day, hour';

    return $queries;
  }