Get child registration link.

@param int $school_id
School ID.
@param int $program_id
Program ID.
@param int $context_id
Rate option ID.

@return string
Registration link.
778850
public function getChildCareRegistrationLink($school_id, $program_id, $context_id) {
    $domain = $this->getUrlFromOpenyProgramsSearchSettings('base_url');

    $map = $this->getMapRateOptions();
    $item = $map[$school_id][$program_id][$context_id];
    return $domain . $item['registration_url'];
  }
1316107
def _get_context_key(self, **kwargs):
        
        return str(kwargs.get(self._resource.parent.id_name))
377010
protected function linkProvider($user_id, $provider, $provider_id, $access_token)
	{
		$user_provider = new Provider;
		$user_provider->user_id = $user_id;
		$user_provider->provider = strtolower($provider);
		$user_provider->provider_id = $provider_id;
		$user_provider->access_token = $access_token;
		$user_provider->save();
		
		return $user_provider;
	}
511996
public function registerSubmitLink(string $elmId, string $formId = '', string $event = self::EVENT_CLIC, string $targetId = '', bool $preventDefault = true)
    {
        $linkSelector = '$("#' . $elmId . '").';
        $script  = $linkSelector . $event . '(function(e){';
        $script .= $preventDefault ? 'e.preventDefault();' : '';
        $target  = $targetId ? ", '" . $targetId . "'" : '';
        $formSelector = $formId
                      ? '$("#' . $formId . '")' 
                      : $linkSelector . 'prev("form")';
        //$script .= 'console.log(' . $formSelector . ');';
        $script .= '$.ajaxCall(' . $formSelector . $target . ')});';
        return $this->registerScript($script);
    }
336531
def get_context_data(self,**kwargs):
        '''  '''
        context = self.get_listing()
        context['showDescriptionRule'] = getConstant('registration__showDescriptionRule') or 'all'
        context.update(kwargs)

        # Update the site session data so that registration processes know to send return links to
        # the registration page.  set_return_page() is in SiteHistoryMixin.
        self.set_return_page('registration',_('Registration'))

        return super(ClassRegistrationView,self).get_context_data(**context)
93344
public function getResourceIDFromSeedKey($seed_key, $context = 'web')
    {
        if (!isset($this->resource_seek_key_map[$context])) {
            $this->resource_seek_key_map[$context] = [];
        }
        if (!isset($this->resource_seek_key_map[$context][$seed_key])) {
            $id = false;
            $alias = $this->getAliasFromSeedKey($seed_key);
            $resource = $this->modx->getObject('modResource', ['alias' => $alias, 'context_key' => $context]);
            if ($resource) {
                $id = $resource->get('id');
                $this->resource_seek_key_map[$context][$seed_key] = $id;
                $this->resource_id_map[$id] = [
                    'context' => $context,
                    'seed_key' => $seed_key
                ];
            }
            $this->resource_seek_key_map[$context][$seed_key] = $id;
        }

        return $this->resource_seek_key_map[$context][$seed_key];
    }
1049626
public function getRelatedEntityUrl() {
    $link = "";
    $related_object = $this->get('field_activity_entity')->getValue();

    if (!empty($related_object)) {
      $target_type = $related_object['0']['target_type'];
      $target_id = $related_object['0']['target_id'];

      // Make an exception for Votes.
      if ($target_type === 'vote') {
        /** @var \Drupal\votingapi\Entity\Vote $vote */
        if ($vote = entity_load($target_type, $target_id)) {
          $target_type = $vote->getVotedEntityType();
          $target_id = $vote->getVotedEntityId();
        }
      }
      elseif ($target_type === 'group_content') {
        /** @var \Drupal\group\Entity\GroupContent $group_content */
        if ($group_content = entity_load($target_type, $target_id)) {
          $target_type = $group_content->getEntity()->getEntityTypeId();
          $target_id = $group_content->getEntity()->id();
        }
      }
      elseif ($target_type === 'event_enrollment') {
        $entity_storage = \Drupal::entityTypeManager()
          ->getStorage($target_type);
        $entity = $entity_storage->load($target_id);

        // Lets make the Event node the target for Enrollments.
        if ($entity !== NULL) {
          /** @var \Drupal\social_event\Entity\EventEnrollment $entity */
          $event_id = $entity->getFieldValue('field_event', 'target_id');
          $target_id = $event_id;
          $target_type = 'node';
        }
      }
      elseif ($target_type === 'flagging') {
        $flagging = Flagging::load($target_id);
        $target_type = $flagging->getFlaggableType();
        $target_id = $flagging->getFlaggableId();
      }

      $entity_storage = \Drupal::entityTypeManager()
        ->getStorage($target_type);
      $entity = $entity_storage->load($target_id);
      if ($entity !== NULL) {
        /** @var \Drupal\Core\Url $link */
        $link = $entity->urlInfo('canonical');
      }
    }
    return $link;
  }
433795
public static function getApplication($base, $client_id = self::ADMIN)
    {
        $_SERVER['SERVER_PORT'] = 80;

        if (!self::$_application)
        {
            self::bootstrap($base);

            $options = array(
                'root_user' => 'root',
                'client_id' => $client_id
            );

            self::$_application = new Application($options);

            $credentials = array(
                'name'      => 'root',
                'username'  => 'root',
                'groups'    => array(8),
                'email'     => 'root@localhost.home'
            );

            self::$_application->authenticate($credentials);

            // If there are no marks in JProfiler debug plugin performs a division by zero using count($marks)
            \JProfiler::getInstance('Application')->mark('Hello world');
        }

        return self::$_application;
    }
1288951
def get_all_outcome_links_for_context_courses(self, course_id, outcome_group_style=None, outcome_style=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - course_id
        """ID"""
        path["course_id"] = course_id

        # OPTIONAL - outcome_style
        """The detail level of the outcomes. Defaults to "abbrev".
        Specify "full" for more information."""
        if outcome_style is not None:
            params["outcome_style"] = outcome_style

        # OPTIONAL - outcome_group_style
        """The detail level of the outcome groups. Defaults to "abbrev".
        Specify "full" for more information."""
        if outcome_group_style is not None:
            params["outcome_group_style"] = outcome_group_style

        self.logger.debug("GET /api/v1/courses/{course_id}/outcome_group_links with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/courses/{course_id}/outcome_group_links".format(**path), data=data, params=params, all_pages=True)
709452
private function getLinksDeclaration()
    {

        // we got a max instances allowed in normality tags
        $links = $this->entity->pgClass->getLinks();
        foreach( $links as &$link ) {
            $link = $link->toArray();
        }
        $links = json_encode( $links );
        $links = Php::varExport( $links, true );

        $this->class->classComponents[] = new VariableDeclaration(
            'links',
            new SFormatf( <<<'PHP'
                /**
                 * Link information for this relation
                 * @var array
                 */
                protected $links = %s;
PHP
                , $links
            )
        );

    }
895375
protected function get_child_course($course) {
        context_helper::preload_from_record($course);
        $context = context_course::instance($course->id);
        $child = new file_info_context_course($this->browser, $context, $course);
        return $child->get_file_info(null, null, null, null, null);
    }
42088
public function getMediaContext($context_id = null)
    {

        if (is_null($context_id)) {
            $context_id = $this->getMediaContextId();
        }

        $context = $this->getClassificationContextManager()->find($context_id);

        if (is_null($context)) {
            $context = $this->getClassificationContextManager()->create();
            $context->setId($context_id);
            $context->setName($context_id);
            $context->setEnabled(true);
            $context->setCreatedAt(new \Datetime());
            $context->setUpdatedAt(new \Datetime());
            $this->getEntityManager()->persist($context);
            $this->getEntityManager()->flush($context);

            $defaultCategory = $this->getClassificationCategoryManager()->create();
            $defaultCategory->setContext($context);
            $defaultCategory->setName($context->getId() . '_default');
            $defaultCategory->setEnabled(true);
            $defaultCategory->setCreatedAt(new \Datetime());
            $defaultCategory->setUpdatedAt(new \Datetime());
            $defaultCategory->setSlug($context->getId() . '_default');
            $defaultCategory->setDescription($context->getId() . '_default');
            $this->getEntityManager()->persist($defaultCategory);
            $this->getEntityManager()->flush($defaultCategory);
        }

        return $context;
    }
959659
public function link_for_activitylink() {
        global $DB;
        $module = $DB->get_record('course_modules', array('id' => $this->properties->activitylink));
        if ($module) {
            $modname = $DB->get_field('modules', 'name', array('id' => $module->module));
            if ($modname) {
                $instancename = $DB->get_field($modname, 'name', array('id' => $module->instance));
                if ($instancename) {
                    return html_writer::link(new moodle_url('/mod/'.$modname.'/view.php',
                        array('id' => $this->properties->activitylink)), get_string('activitylinkname',
                        'lesson', $instancename), array('class' => 'centerpadded lessonbutton standardbutton p-r-1'));
                }
            }
        }
        return '';
    }
877886
def get_context_data(self,**kwargs):
        '''  '''
        context_data = super(RegistrationSummaryView,self).get_context_data(**kwargs)

        regSession = self.request.session[REG_VALIDATION_STR]
        reg_id = regSession["temp_reg_id"]
        reg = TemporaryRegistration.objects.get(id=reg_id)

        discount_codes = regSession.get('discount_codes',None)
        discount_amount = regSession.get('total_discount_amount',0)
        voucher_names = regSession.get('voucher_names',[])
        total_voucher_amount = regSession.get('total_voucher_amount',0)
        addons = regSession.get('addons',[])

        if reg.priceWithDiscount == 0:
            # Create a new Invoice if one does not already exist.
            new_invoice = Invoice.get_or_create_from_registration(reg,status=Invoice.PaymentStatus.paid)
            new_invoice.processPayment(0,0,forceFinalize=True)
            isFree = True
        else:
            isFree = False

        context_data.update({
            'registration': reg,
            "totalPrice": reg.totalPrice,
            'subtotal': reg.priceWithDiscount,
            'taxes': reg.addTaxes,
            "netPrice": reg.priceWithDiscountAndTaxes,
            "addonItems": addons,
            "discount_codes": discount_codes,
            "discount_code_amount": discount_amount,
            "voucher_names": voucher_names,
            "total_voucher_amount": total_voucher_amount,
            "total_discount_amount": discount_amount + total_voucher_amount,
            "currencyCode": getConstant('general__currencyCode'),
            'payAtDoor': reg.payAtDoor,
            'is_free': isFree,
        })

        if self.request.user:
            door_permission = self.request.user.has_perm('core.accept_door_payments')
            invoice_permission = self.request.user.has_perm('core.send_invoices')

            if door_permission or invoice_permission:
                context_data['form'] = DoorAmountForm(
                    user=self.request.user,
                    doorPortion=door_permission,
                    invoicePortion=invoice_permission,
                    payerEmail=reg.email,
                    discountAmount=max(reg.totalPrice - reg.priceWithDiscount,0),
                )

        return context_data
770031
public function getLtiByRlid($resource_link_id)
    {
        foreach($this->lessons->modules as $mod) {
            if ( ! isset($mod->lti) ) continue;
            foreach($mod->lti as $lti ) {
                if ( $lti->resource_link_id == $resource_link_id) return $lti;
            }
        }
        return null;
    }
396246
public static function get_instance_info($instanceid) {
        global $DB, $CFG;

        require_once($CFG->libdir . '/enrollib.php');

        $params = self::validate_parameters(self::get_instance_info_parameters(), array('instanceid' => $instanceid));

        // Retrieve self enrolment plugin.
        $enrolplugin = enrol_get_plugin('self');
        if (empty($enrolplugin)) {
            throw new moodle_exception('invaliddata', 'error');
        }

        self::validate_context(context_system::instance());

        $enrolinstance = $DB->get_record('enrol', array('id' => $params['instanceid']), '*', MUST_EXIST);
        $course = $DB->get_record('course', array('id' => $enrolinstance->courseid), '*', MUST_EXIST);
        if (!core_course_category::can_view_course_info($course) && !can_access_course($course)) {
            throw new moodle_exception('coursehidden');
        }

        $instanceinfo = (array) $enrolplugin->get_enrol_info($enrolinstance);
        if (isset($instanceinfo['requiredparam']->enrolpassword)) {
            $instanceinfo['enrolpassword'] = $instanceinfo['requiredparam']->enrolpassword;
        }
        unset($instanceinfo->requiredparam);

        return $instanceinfo;
    }
404962
public function get_url() {
        $params = array('id' => $this->contextinstanceid);
        if (!empty($this->other['mode'])) {
            $params['mode'] = $this->other['mode'];
        }
        return new \moodle_url("/mod/$this->objecttable/view.php", $params);
    }