Retrieve custom DQL date time functions.

@return array
488845
protected function getCustomDateTimeFunctions()
    {
        $functions = (array) $this->getOption('custom_datetime_functions');

        return array_filter(
            $functions,
            function ($name) {
                return is_string($name);
            },
            ARRAY_FILTER_USE_KEY
        );
    }
1263863
private function getDwnlLog($datestamp)
    {
        $result = [];
        /* prepare query parameters */
        $tsFrom = $this->hlpPeriod->getTimestampFrom($datestamp);
        $periodTo = $this->hlpPeriod->getPeriodCurrent();
        $tsTo = $this->hlpPeriod->getTimestampTo($periodTo);
        /* perform query */
        $query = $this->qGetChanges->build();
        $conn = $query->getConnection();
        $bind = [
            QGetChanges::BND_DATE_FROM => $tsFrom,
            QGetChanges::BND_DATE_TO => $tsTo
        ];
        $rs = $conn->fetchAll($query, $bind);
        /* compose result */
        foreach ($rs as $one) {
            $item = new EChange($one);
            $result[] = $item;
        }

        return $result;
    }
36432
public static function getGroupedTimeZones(): array
	{
		$timeZones = [];

		foreach(static::listIdentifiers() as $timeZone)
		{
			[$group, $city] = explode('/', $timeZone, 2) + [null, null];

			$timeZones[$group][$timeZone] = str_replace('_', ' ', $city);
		}

		unset($timeZones['UTC']);

		return $timeZones;
	}
856962
protected function getFunctions() {
        if (!$this->_functions) {
            $this->_functions = new FunctionList($this->version, $this->solution['sid']);
        }

        return $this->_functions;
    }
157393
public function jsonSerialize()
    {
        if ($this->blnDateNull) {
            $dt = self::now();    // time only will use today's date.
            $dt->setTime($this);
        } else {
            $dt = clone $this;
        }

        if ($this->blnTimeNull) {
            return [
                QCubed::JSON_OBJECT_TYPE => 'qDateTime',
                'year' => $dt->Year,
                'month' => $dt->Month - 1,
                'day' => $dt->Day
            ];
        } else {
            return [
                QCubed::JSON_OBJECT_TYPE => 'qDateTime',
                'year' => $dt->Year,
                'month' => $dt->Month - 1,
                'day' => $dt->Day,
                'hour' => $dt->Hour,
                'minute' => $dt->Minute,
                'second' => $dt->Second
            ];
        }
    }
793727
public function getDateUnitsList()
    {
        return array(
            'S' => $this->translate->_('Seconds'),
            'N' => $this->translate->_('Minutes'),
            'H' => $this->translate->_('Hours'),
            'D' => $this->translate->_('Days'),
            'W' => $this->translate->_('Weeks'),
            'M' => $this->translate->_('Months'),
            'Q' => $this->translate->_('Quarters'),
            'Y' => $this->translate->_('Years')
        );
    }
1091608
private function getVersionList()
    {
        /* @var \Concrete\Core\Form\Service\Widget\DateTime $dt */
        $dt = $this->app->make('helper/form/date_time');

        $startDate = $dt->translate('startDate', null, true);
        $endDate = $dt->translate('endDate', null, true);

        $versionList = new GlobalVersionList();
        $versionList->sortByDateApprovedDesc();

        if ($startDate !== null) {
            $versionList->filterByApprovedAfter($startDate);
        }

        if ($endDate !== null) {
            $versionList->filterByApprovedBefore($endDate);
        }

        return $versionList;
    }
1282272
public function retrieveCalendarEvents(){
        
        $select = $this->tableGateway->getSql()->select();
        // preparing columns for calendar ui
        // as defined column name for calendar ui
        $select->columns(
            array(
                new \Zend\Db\Sql\Expression('cal_id AS id'),
                new \Zend\Db\Sql\Expression('CONCAT(cal_id," : ",cal_event_title) AS title'),
                new \Zend\Db\Sql\Expression('cal_date_start AS start'),
                new \Zend\Db\Sql\Expression('cal_date_end AS end'),
            ));
        $dataCalendar = $this->tableGateway->selectWith($select);
        
        return $dataCalendar;
    }
1165762
public function getCompatibleTimezones()
    {
        $validTimezones = [];
        foreach ($this->dateHelper->getTimezones() as $timezoneID => $timezoneName) {
            if ($this->getDeltaTimezone($timezoneID) === null) {
                $validTimezones[$timezoneID] = $timezoneName;
            }
        }

        return $validTimezones;
    }
468410
protected static function getDateTime()
    {
        // Lazyload
        if (null === self::$dateTime) {
            /* @var Doozr_Datetime_Service self::$dateTime */
            self::$dateTime = Doozr_Loader_Serviceloader::load('datetime');
        }

        return self::$dateTime;
    }
671583
public function enabledTimestampFields()
    {
        $fields = [];
        if (is_string($this->createdAtAttribute) && !empty($this->createdAtAttribute)) {
            $fields[] = $this->createdAtAttribute;
        }
        if (is_string($this->updatedAtAttribute) && !empty($this->updatedAtAttribute)) {
            $fields[] = $this->updatedAtAttribute;
        }
        if (is_string($this->expiredAfterAttribute) && !empty($this->expiredAfterAttribute)) {
            $fields[] = $this->expiredAfterAttribute;
        }
        return $fields;
    }
735078
public function getFunctions()
    {
        //Function definition
        return array(
            'mesd_jasper_reportviewer_stored_report_link' => new \Twig_Function_Method($this, 'renderStoredReportLink',  array('is_safe' => array('html'))),
            'mesd_jasper_reportviewer_report_link' => new \Twig_Function_Method($this, 'renderReportLink',  array('is_safe' => array('html'))),
            'mesd_jasper_reportviewer_home' => new \Twig_Function_Method($this, 'renderReportHome', array('is_safe' => array('html'))),
            'mesd_jasper_reportviewer_uri' => new \Twig_Function_Method($this, 'renderReportURI', array('is_safe' => array('html'))),
            'mesd_jasper_reportviewer_direct_link' => new \Twig_Function_Method($this, 'renderDirectReportLink', array('is_safe' => array('html')))
        );
    }
500577
public function getFormats()
    {
        return [
            'date'     => $this->getDateFormatHelper()->getFormatsDate(),
            'datetime' => $this->getDateFormatHelper()->getFormatsDateTime(),
            'time'     => $this->getDateFormatHelper()->getFormatsTime(),
            'number'   => $this->formatNumber,
            'boolean'  => $this->formatBoolean,
            'string'   => $this->formatString,
            'region'   => $this->formatString,
            'tel'      => $this->formatTel,
            'text'     => $this->formatText,
            'email'    => $this->formatEmail,
        ];
    }
171437
public function getFunctions() {
        return array(
            new \Twig_SimpleFunction('gchart_area_chart', array($this, 'gchartAreaChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_bar_chart', array($this, 'gchartBarChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_bubble_chart', array($this, 'gchartBubbleChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_calendar', array($this, 'gchartCalendar'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_candlestick_chart', array($this, 'gchartCandleStickChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_column_chart', array($this, 'gchartColumnChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_combo_chart', array($this, 'gchartComboChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_donut_chart', array($this, 'gchartDonutChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_gantt', array($this, 'gchartGantt'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_gauge', array($this, 'gchartGauge'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_geo_chart', array($this, 'gchartGeoChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_get_icon_pin_url', array($this, 'getIconPinUrl'), array('is_safe' => array('html'))),
            new \Twig_SimpleFunction('gchart_get_icon_url', array($this, 'getIconUrl'), array('is_safe' => array('html'))),
            new \Twig_SimpleFunction('gchart_get_letter_pin_url', array($this, 'getLetterPinUrl'), array('is_safe' => array('html'))),
            new \Twig_SimpleFunction('gchart_get_pie_chart_url', array($this, 'getPieChartUrl'), array('is_safe' => array('html'))),
            new \Twig_SimpleFunction('gchart_get_pie_chart3d_url', array($this, 'getPieChart3DUrl'), array('is_safe' => array('html'))),
            new \Twig_SimpleFunction('gchart_get_qrcode_url', array($this, 'getQrCodeUrl')),
            new \Twig_SimpleFunction('gchart_histogram', array($this, 'gchartHistogram'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_interval', array($this, 'gchartInterval'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_line_chart', array($this, 'gchartLineChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_map', array($this, 'gchartMap'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_org_chart', array($this, 'gchartOrgChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_pie_chart', array($this, 'gchartPieChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_sankey', array($this, 'gchartSankey'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_scatter_chart', array($this, 'gchartScatterChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_stepped_area_chart', array($this, 'gchartSteppedAreaChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_table', array($this, 'gchartTable'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_timeline', array($this, 'gchartTimeline'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_treemap', array($this, 'gchartTreeMap'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_trendlines', array($this, 'gchartTrendlines'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_waterfall', array($this, 'gchartWaterfall'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_word_tree', array($this, 'gchartWordTree'), array('is_safe' => array('html'), 'needs_environment' => true)),
        );
    }
835127
public function getQueriesTime()
  {
    $res = array_reduce($this->getQueries(), function($result, $arr){
      if (isset($arr['time'])) {
        $result[] = $arr['time'];
      }

      return $result;
    }, array());

    return array_sum($res);
  }
375562
protected function getFunctionVersions() {
        if (!$this->_functionVersions) {
            $this->_functionVersions = new FunctionVersionList(
                $this->version,
                $this->solution['serviceSid'],
                $this->solution['sid']
            );
        }

        return $this->_functionVersions;
    }
1089093
public static function getStartEndMonth() : array
    {
        date_default_timezone_set('UTC');
        $begin = mktime(0, 0, 0, date('m'), 1, date("Y"));
        $end = mktime(23, 59, 59, date('m'), date("t"), date("Y"));
        return [
            'begin' => $begin,
            'end' => $end
        ];
    }