public function findCalculateDate(Range $interval): array
	{
		$result = [];
		if (!isset($this->isCalculated[(string) $interval])) {
			$this->isCalculated[(string) $interval] = true;

			// dopocita posledni den
			if ($interval->to->format('Y-m-d') >= (new DateTime)->format('Y-m-d')) {
				$last = $this->connection->query('SELECT MAX([datefield]) datefield FROM %table', $this->getTableName())->fetch();
				if ($last) {
					$result[] = $last->datefield;
				}
			}

			// chybejici dny
			$dates = 'SELECT DATE_ADD(DATE(%dt), INTERVAL t4 + t16 + t64 + t256 + t1024 DAY) missingDate 
                    FROM 
                        (SELECT 0 t4    UNION ALL SELECT 1   UNION ALL SELECT 2   UNION ALL SELECT 3  ) t4,
                        (SELECT 0 t16   UNION ALL SELECT 4   UNION ALL SELECT 8   UNION ALL SELECT 12 ) t16,   
                        (SELECT 0 t64   UNION ALL SELECT 16  UNION ALL SELECT 32  UNION ALL SELECT 48 ) t64,      
                        (SELECT 0 t256  UNION ALL SELECT 64  UNION ALL SELECT 128 UNION ALL SELECT 192) t256,     
                        (SELECT 0 t1024 UNION ALL SELECT 256 UNION ALL SELECT 512 UNION ALL SELECT 768) t1024';

			$visits = 'SELECT DATE([datefield]) '
				. 'FROM %table '
				. 'WHERE DATE([datefield]) BETWEEN DATE(%dt) AND DATE(%dt)';

			$calculateDates = $this->connection->query('SELECT DATE([missingDate]) date FROM (' . $dates . ') dates '
				. 'WHERE [missingDate] NOT IN (' . $visits . ') '
				. 'AND [missingDate] <= DATE(%dt)', $interval->from, $this->getTableName(), $interval->from, $interval->to, $interval->to);

			if ($calculateDates) {
				foreach ($calculateDates as $date) {
					$result[] = $date->date;
				}
			}
		}
		return $result;
	}
public function findCalculateDate(Range $interval): array
	{
		$result = [];
		if (!isset($this->isCalculated[(string) $interval])) {
			$this->isCalculated[(string) $interval] = true;

			// dopocita posledni den
			if ($interval->to->format('Y-m-d') >= (new DateTime)->format('Y-m-d')) {
				$last = $this->connection->query('SELECT MAX([datefield]) datefield FROM %table', $this->getTableName())->fetch();
				if ($last) {
					$result[] = $last->datefield;
				}
			}

			// chybejici dny
			$dates = 'SELECT DATE_ADD(DATE(%dt), INTERVAL t4 + t16 + t64 + t256 + t1024 DAY) missingDate 
                    FROM 
                        (SELECT 0 t4    UNION ALL SELECT 1   UNION ALL SELECT 2   UNION ALL SELECT 3  ) t4,
                        (SELECT 0 t16   UNION ALL SELECT 4   UNION ALL SELECT 8   UNION ALL SELECT 12 ) t16,   
                        (SELECT 0 t64   UNION ALL SELECT 16  UNION ALL SELECT 32  UNION ALL SELECT 48 ) t64,      
                        (SELECT 0 t256  UNION ALL SELECT 64  UNION ALL SELECT 128 UNION ALL SELECT 192) t256,     
                        (SELECT 0 t1024 UNION ALL SELECT 256 UNION ALL SELECT 512 UNION ALL SELECT 768) t1024';

			$visits = 'SELECT DATE([datefield]) '
				. 'FROM %table '
				. 'WHERE DATE([datefield]) BETWEEN DATE(%dt) AND DATE(%dt)';

			$calculateDates = $this->connection->query('SELECT DATE([missingDate]) date FROM (' . $dates . ') dates '
				. 'WHERE [missingDate] NOT IN (' . $visits . ') '
				. 'AND [missingDate] <= DATE(%dt)', $interval->from, $this->getTableName(), $interval->from, $interval->to, $interval->to);

			if ($calculateDates) {
				foreach ($calculateDates as $date) {
					$result[] = $date->date;
				}
			}
		}
		return $result;
	}
public function findCalculateDate ( Range $ interval ) : array { $ result = [ ] ; if ( ! isset ( $ this -> isCalculated [ ( string ) $ interval ] ) ) { $ this -> isCalculated [ ( string ) $ interval ] = true ; // dopocita posledni den if ( $ interval -> to -> format ( 'Y-m-d' ) >= ( new DateTime ) -> format ( 'Y-m-d' ) ) { $ last = $ this -> connection -> query ( 'SELECT MAX([datefield]) datefield FROM %table' , $ this -> getTableName ( ) ) -> fetch ( ) ; if ( $ last ) { $ result [ ] = $ last -> datefield ; } } // chybejici dny $ dates = 'SELECT DATE_ADD(DATE(%dt), INTERVAL t4 + t16 + t64 + t256 + t1024 DAY) missingDate 
                    FROM 
                        (SELECT 0 t4    UNION ALL SELECT 1   UNION ALL SELECT 2   UNION ALL SELECT 3  ) t4,
                        (SELECT 0 t16   UNION ALL SELECT 4   UNION ALL SELECT 8   UNION ALL SELECT 12 ) t16,   
                        (SELECT 0 t64   UNION ALL SELECT 16  UNION ALL SELECT 32  UNION ALL SELECT 48 ) t64,      
                        (SELECT 0 t256  UNION ALL SELECT 64  UNION ALL SELECT 128 UNION ALL SELECT 192) t256,     
                        (SELECT 0 t1024 UNION ALL SELECT 256 UNION ALL SELECT 512 UNION ALL SELECT 768) t1024' ; $ visits = 'SELECT DATE([datefield]) ' . 'FROM %table ' . 'WHERE DATE([datefield]) BETWEEN DATE(%dt) AND DATE(%dt)' ; $ calculateDates = $ this -> connection -> query ( 'SELECT DATE([missingDate]) date FROM (' . $ dates . ') dates ' . 'WHERE [missingDate] NOT IN (' . $ visits . ') ' . 'AND [missingDate] <= DATE(%dt)' , $ interval -> from , $ this -> getTableName ( ) , $ interval -> from , $ interval -> to , $ interval -> to ) ; if ( $ calculateDates ) { foreach ( $ calculateDates as $ date ) { $ result [ ] = $ date -> date ; } } } return $ result ; }
Vrati datum, ktere je treba prepocitat
@param Range $interval
@return DateTime[]
@throws QueryException
Vrati datum ktere je treba prepocitat