Return all games for day
@return \Drupal\mespronos\Entity\Game[]
437866
public function getGames() {
    $injected_database = Database::getConnection();
    $query = $injected_database->select('mespronos__game', 'g');
    $query->join('mespronos__day', 'd', 'd.id = g.day');
    $query->addField('g', 'id');
    $query->condition('d.league', $this->id());
    $results = $query->execute()->fetchAllAssoc('id');

    $results = array_map(function ($v) {return $v->id;}, $results);
    return Game::loadMultiple($results);
  }
1090188
protected function getDays()
    {
        $intSecondsPerDay = ($this->isPositive()) ? DateTimeSpan::SECONDS_PER_DAY : ((-1) * DateTimeSpan::SECONDS_PER_DAY);
        $intDays = floor($this->intSeconds / $intSecondsPerDay);
        if ($this->isNegative()) {
            $intDays = (-1) * $intDays;
        }
        return $intDays;
    }
680601
public function getActiveCampaigns() {
    // All dates are stored in database in UTC timezone.
    // Get current datetime in UTC timezone.
    $dt = new \DateTime('now', new \DateTimezone(DATETIME_STORAGE_TIMEZONE));
    $now = DrupalDateTime::createFromDateTime($dt);

    /** @var \Drupal\node\NodeStorage $nodeStorage */
    $nodeStorage = $this->entityTypeManager->getStorage('node');

    $campaignIds = $nodeStorage->getQuery()
      ->condition('type', 'campaign')
      ->condition('status', TRUE)
      ->condition('field_campaign_end_date', $now->format(DATETIME_DATETIME_STORAGE_FORMAT), '>=')
      ->sort('created', 'DESC')
      ->execute();
    $campaigns = $nodeStorage->loadMultiple($campaignIds);

    return !empty($campaigns) ? $campaigns : NULL;
  }
77646
public function retrieveDashboardCalendarEvents(){
        $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('DISTINCT(cal_date_start) AS dates')));
        $dataCalendar = $this->tableGateway->selectWith($select);
        
        return $dataCalendar;
    }
1071837
public function getAll()
    {
        if(!$this->skipCriteria) {
            foreach($this->getterCriteria as $criteria) {
                $this->repository = $this->repository->pushCriteria(app($criteria));
            }
        }
        if(!$this->skipRelations) {
            $this->repository = $this->repository->with($this->relations);
        }

        return $this->repository->all();
    }
430902
public function getStatuses()
    {
        $schedules = clone $this->getCollection()
            ->setOrder('status', Zend_Db_Select::SQL_ASC);
        $schedules->getSelect()
            ->group('status')
            ->reset(Zend_Db_Select::COLUMNS)
            ->columns('status');
        $statuses = $schedules->getConnection()
            ->fetchCol($schedules->getSelect());
        $statusArray = array();
        foreach ($statuses as $status) {
            $statusArray[$status] = $status;
        }
        return $statusArray;
    }
653585
public function getDays()
    {
        $days = array();
        foreach ($this->getDatePeriod() as $date) {
            $days[] = $this->getFactory()->createDay($date);
        }

        return $days;
    }
742998
public function getExecTasks(): array
    {
        $data = [];
        $runTimeTableTasks = $this->getRunTimeTable()->table;
        if (\count($runTimeTableTasks) <= 0) {
            return $data;
        }

        $min = date('YmdHi');

        foreach ($runTimeTableTasks as $key => $value) {
            if ($value['minute'] == $min) {
                if (time() == $value['sec'] && $value['runStatus'] == self::NORMAL) {
                    $data[] = [
                        'key'        => $key,
                        'taskClass'  => $value['taskClass'],
                        'taskMethod' => $value['taskMethod'],
                    ];
                }
            }
        }

        foreach ($data as $item) {
            $this->startTask($item['key']);
        }

        return $data;
    }
1203802
private function setDay()
    {
        return [
            1 => $this->app->trans('phraseanet::jours:: lundi'),
            2 => $this->app->trans('phraseanet::jours:: mardi'),
            3 => $this->app->trans('phraseanet::jours:: mercredi'),
            4 => $this->app->trans('phraseanet::jours:: jeudi'),
            5 => $this->app->trans('phraseanet::jours:: vendredi'),
            6 => $this->app->trans('phraseanet::jours:: samedi'),
            7 => $this->app->trans('phraseanet::jours:: dimanche')];
    }
1371568
public static function weekends() : array
    {
        $days        = self::getAll();
        $weekEndDays = [];

        foreach ($days as $key => $day) {
            if ($day->isWeekEnd()) {
                $weekEndDays[] = $day;
            }
        }

        return $weekEndDays;
    }
275598
def games_for_date(year, month, day)
      games_page = GamedayFetcher.fetch_games_page(year, month, day)
      gids = find_gid_for_date(year, month, day, games_page)
      if gids
        results = gids.collect {|gid| Game.new(gid) }
      else 
        results = nil
      end
      results
    end
150075
public function getTasks()
    {
        $tasks = [];

        foreach ($this->getKernelEvents() as $event) {
            $tasks[] = [
                'task'          => $this->formatTask($event),
                'expression'    => $event->expression,
                'nextRunDate'   => $event->nextRunDate()->format('Y-m-d H:i:s'),
                'description'   => $event->description,
                'readable'      => CronSchedule::fromCronString($event->expression)->asNaturalLanguage(),
            ];
        }

        return $tasks;
    }
705941
public static function getAll(): array
    {
        return [
            self::GET,
            self::HEAD,
            self::POST,
            self::PUT,
            self::DELETE,
            self::CONNECT,
            self::OPTIONS,
            self::TRACE,
            self::PATCH,
        ];
    }
588383
public function get_weekdays() {
        return array(
            0 => array(
                'shortname' => get_string('sun', 'calendar'),
                'fullname' => get_string('sunday', 'calendar')
            ),
            1 => array(
                'shortname' => get_string('mon', 'calendar'),
                'fullname' => get_string('monday', 'calendar')
            ),
            2 => array(
                'shortname' => get_string('tue', 'calendar'),
                'fullname' => get_string('tuesday', 'calendar')
            ),
            3 => array(
                'shortname' => get_string('wed', 'calendar'),
                'fullname' => get_string('wednesday', 'calendar')
            ),
            4 => array(
                'shortname' => get_string('thu', 'calendar'),
                'fullname' => get_string('thursday', 'calendar')
            ),
            5 => array(
                'shortname' => get_string('fri', 'calendar'),
                'fullname' => get_string('friday', 'calendar')
            ),
            6 => array(
                'shortname' => get_string('sat', 'calendar'),
                'fullname' => get_string('saturday', 'calendar')
            ),
        );
    }
49157
public function getCalendars()
    {
        //build URI
        $strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/calendars/';

        //sign URI
        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');

        $json = json_decode($responseStream);

        if ($json->Code == 200)
            return $json->Calendars->List;
        else
            return false;
    }
1111018
public static function getUniqueObjects()
    {
        $all = (new Orm\CmsStatDateQuery)
            ->whereHour()->equals(null)
            ->andFieldDay()->equals(null)
            ->andFieldMonth()->equals(null)
            ->andFieldObjectId()->equals(null)
            ->orderAscObject()
            ->find();
        $objects = [];
        foreach ($all as $object) {
            if (!isset($objects[$object->object])) {
                $objects[$object->object] = $object->object;
            }
        }
        return $objects;
    }
1146030
public static function getWeekdays() {
		return array(
			self::MONDAY,
			self::TUESDAY,
			self::WEDNESDAY,
			self::THURSDAY,
			self::FRIDAY,
			self::SATURDAY,
			self::SUNDAY,
		);
	}