Returns an array of all active instances for this definition.
(intentionally does not return instances with status NEEDUPDATE)

@param int since only return instances with timemodified >= since
@return array of gradingform_instance objects
359362
public function get_all_active_instances($since = 0) {
        global $DB;
        $conditions = array ($this->definition->id,
                             gradingform_instance::INSTANCE_STATUS_ACTIVE,
                             $since);
        $where = "definitionid = ? AND status = ? AND timemodified >= ?";
        $records = $DB->get_records_select('grading_instances', $where, $conditions);
        $rv = array();
        foreach ($records as $record) {
            $rv[] = $this->get_instance($record);
        }
        return $rv;
    }
836646
public function getActiveTimers()
    {
        $result = $this->getActiveUsers( );
        if ( $result->isSuccess() ) {
            $data = array();
            foreach ($result->data as $user) {
                $subResult = $this->getUserEntries( $user->id, Range::today( $this->_timeZone ) );
                if ( $subResult->isSuccess() ) {
                    foreach ($subResult->data as $entry) {
                        if ($entry->timer_started_at != null || $entry->timer_started_at != "") {
                            $data[$user->id] = $entry;
                            break;
                        }
                    }
                }
            }
            $result->data = $data;
        }

        return $result;
    }
358422
public function listNotifications(bool $all = false, bool $participating = false, string $since = 'now',
                                      string $before = null): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/notifications?:args', http_build_query([
            'all'           => $all,
            'participating' => $participating,
            'since'         => (new DateTime($since))->format(DateTime::ATOM),
            'before'        => (new DateTime($before))->format(DateTime::ATOM)
        ])));
    }
964763
public function display_instance(gradingform_guide_instance $instance, $idx, $cangrade) {
        $criteria = $instance->get_controller()->get_definition()->guide_criteria;
        $options = $instance->get_controller()->get_options();
        $values = $instance->get_guide_filling();
        if ($cangrade) {
            $mode = gradingform_guide_controller::DISPLAY_REVIEW;
        } else {
            $mode = gradingform_guide_controller::DISPLAY_VIEW;
        }

        $output = $this->box($instance->get_controller()->get_formatted_description(), 'gradingform_guide-description').
                  $this->display_guide($criteria, array(), $options, $mode, 'guide'.$idx, $values);
        return $output;
    }
413346
public Iterator getCurrentServiceClasses() {

        ArrayList<Class> currentClasses = new ArrayList<Class>();
        for (Class serviceClass : _serviceProviders.keySet()) {
            ServiceProvider sp = _serviceProviders.get(serviceClass);
            if (!sp.isRevoked() && !sp.isDelegated()) {
                currentClasses.add(serviceClass);
            }
        }
        return currentClasses.iterator();
    }
71652
protected function getUsageRecords() {
        if (!$this->_usageRecords) {
            $this->_usageRecords = new UsageRecordList($this->version, $this->solution['sid']);
        }

        return $this->_usageRecords;
    }
866367
@Transactional
	public List<ProcessInstance> getActiveProcesses() {
		if (log.isDebugEnabled()) {
			getAllProcesses();
		}
		Query query = m_entityManager.createNamedQuery("ActiveProcesses");
		@SuppressWarnings("unchecked")
		List<ProcessInstance> result = query.getResultList();
		if (log.isDebugEnabled()) {
			for (ProcessInstance processInstance:result) {
				log.debug("processInstanceId={} processName={} taskId={} status={}",processInstance.getId(),processInstance.getProcessDefinitionName(),processInstance.getTaskId(), processInstance.getStatus());
			}
			log.debug("found {} active processes",result.size());
		}
		return result;
	}
1004343
public function getPromoFinishedList()
    {
        if (isset($this->_oPromoFinishedList)) {
            return $this->_oPromoFinishedList;
        }
        $this->_oPromoFinishedList = oxNew(\OxidEsales\Eshop\Application\Model\ActionList::class);
        $this->_oPromoFinishedList->loadFinishedByCount(2);

        return $this->_oPromoFinishedList;
    }
1117494
public function get_instance_defaults() {
        $expirynotify = $this->get_config('expirynotify');
        if ($expirynotify == 2) {
            $expirynotify = 1;
            $notifyall = 1;
        } else {
            $notifyall = 0;
        }

        $fields = array();
        $fields['status']          = $this->get_config('status');
        $fields['roleid']          = $this->get_config('roleid');
        $fields['enrolperiod']     = $this->get_config('enrolperiod');
        $fields['expirynotify']    = $expirynotify;
        $fields['notifyall']       = $notifyall;
        $fields['expirythreshold'] = $this->get_config('expirythreshold');
        $fields['customint1']      = $this->get_config('groupkey');
        $fields['customint2']      = $this->get_config('longtimenosee');
        $fields['customint3']      = $this->get_config('maxenrolled');
        $fields['customint4']      = $this->get_config('sendcoursewelcomemessage');
        $fields['customint5']      = 0;
        $fields['customint6']      = $this->get_config('newenrols');

        return $fields;
    }
1274565
public function getFiscalYears()
  {
    $fiscalYears = array();

    $this->FiscalYear->byOrganization($this->AuthenticationManager->getCurrentUserOrganizationId())->each(function($FiscalYear) use (&$fiscalYears)
    {
      array_push($fiscalYears, $FiscalYear->year);
    });

    return $fiscalYears;
  }
750318
public function listPublicRepositories(string $since = '1970-01-01'): array
    {
        return $this->getApi()->request($this->getApi()
                                             ->sprintf('/repositories?:arg', http_build_query(['since', $since])));
    }
802488
public function getAllForInsertUpdate()
    {
        $data          = parent::getAllForInsertUpdate();
        if ($this->_from !== null) {
            $data['_from'] = $this->_from;
        }
        if ($this->_to !== null) {
            $data['_to']   = $this->_to;
        }

        return $data;
    }
1270179
public function getClasses()
    {
        $classes = [];
        $current = $this->head;
        while ($current && $current->value) {
            $classes[] = $current->value;
            $current = $current->next;
        }

        return array_filter($classes);
    }
731699
public function getAll()
    {
        $instances = array();
        $builder = new InstanceBuilder();

        foreach ($this->data as $className => $args) {
            if (class_exists($className)) {

                $instance = $builder->build($className, $args);
                array_push($instances, $instance);
            }
        }

        return $instances;
    }
584981
public function get_active_controller() {
        if ($gradingmethod = $this->get_active_method()) {
            $controller = $this->get_controller($gradingmethod);
            if ($controller->is_form_available()) {
                return $controller;
            }
        }
        return null;
    }
958599
public function getActiveClients()
    {
        $result = $this->getClients();
        if ( $result->isSuccess() ) {
            $clients = array();
            foreach ($result->data as $client) {
                if ($client->active == "true") {
                    $clients[$client->id] = $client;
                }
            }
            $result->data = $clients;
        }

        return $result;
    }
1343611
public function getActive()
    {
        if (count($this->active) < 1) {
            return null;
        }
        while (time() > current($this->active)) {
            $key = key($this->active);
            $this->expired[$key] = current($this->active);
            $this->increment($this->active);
            unset($this->active[$key]);
            if (count($this->active) < 1) {
                return null;
            }
        }
        $active = key($this->active);
        $this->increment($this->active);
        return $active;
    }