@param string $summerInternDept

@return Education
166466
public function setSummerInternDept($summerInternDept)
    {
        if (
                !is_string($summerInternDept)
             && !is_null($summerInternDept)
        ) {
            throw new \InvalidArgumentException(
                __CLASS__ . ' ' . __METHOD__ . ': Not a string'
            );
        }

        $this->summerInternDept = $summerInternDept;

        return $this;
    }
1329607
public function replaceChildBy(AbstractClassContent $prevContentSet, AbstractClassContent $nextContentSet)
    {
        $index = $this->indexOfByUid($prevContentSet, true);
        if (is_bool($index)) {
            return false;
        }

        return $this->replaceChildAtBy($index, $nextContentSet);
    }
679870
public function member_program_unit_create(
        VO\Token $token,
        VO\ID $program_unit_id,
        VO\ApprenticeshipID $member_apprenticeship_id,
        VO\Integer $is_started = null,
        VO\Integer $is_completed = null,
        VO\Integer $is_submitted_for_assessment = null,
        VO\StringVO $observation

    ){
        $request = new Request(
            new GuzzleClient,
            $this->credentials,
            VO\HTTP\Url::fromNative($this->base_url.'/student/member/program/unit/create'),
            new VO\HTTP\Method('POST')
        );

        $request_parameters = array(
            'program_unit_id' => $program_unit_id->__toString(),
            'member_apprenticeship_id' => $member_apprenticeship_id->__toString(),
            'observation' => $observation->__toString()
        );

        if(!is_null($is_started)){
            $request_parameters['is_started'] = $is_started->__toInteger();
        }

        if(!is_null($is_completed)){
            $request_parameters['is_completed'] = $is_completed->__toInteger();
        }

        if(!is_null($is_submitted_for_assessment)){
            $request_parameters['is_submitted_for_assessment'] = $is_submitted_for_assessment->__toInteger();
        }

        $header_parameters = array('Authorization' => $token->__toEncodedString());

        $response = $request->send($request_parameters, $header_parameters);

        $data = $response->get_data();

        return $data;
    }
929239
protected function getIntermediatePath($hint)
    {
        $namespace = config("flame.{$hint}.namespace");
        $namespaceTail = substr($this->controllerNamespace(), strlen($namespace) + 1);

        return collect(explode('\\', $namespaceTail))->splice(0, -2)->implode('.');
    }
1230455
function enrol_page_hook(stdClass $instance) {
        global $CFG, $USER, $OUTPUT, $PAGE, $DB;

        ob_start();

        if ($DB->record_exists('user_enrolments', array('userid'=>$USER->id, 'enrolid'=>$instance->id))) {
            return ob_get_clean();
        }

        if ($instance->enrolstartdate != 0 && $instance->enrolstartdate > time()) {
            return ob_get_clean();
        }

        if ($instance->enrolenddate != 0 && $instance->enrolenddate < time()) {
            return ob_get_clean();
        }

        $course = $DB->get_record('course', array('id'=>$instance->courseid));
        $context = context_course::instance($course->id);

        $shortname = format_string($course->shortname, true, array('context' => $context));
        $strloginto = get_string("loginto", "", $shortname);
        $strcourses = get_string("courses");

        // Pass $view=true to filter hidden caps if the user cannot see them
        if ($users = get_users_by_capability($context, 'moodle/course:update', 'u.*', 'u.id ASC',
                                             '', '', '', '', false, true)) {
            $users = sort_by_roleassignment_authority($users, $context);
            $teacher = array_shift($users);
        } else {
            $teacher = false;
        }

        if ( (float) $instance->cost <= 0 ) {
            $cost = (float) $this->get_config('cost');
        } else {
            $cost = (float) $instance->cost;
        }

        if (abs($cost) < 0.01) { // no cost, other enrolment methods (instances) should be used
            echo '<p>'.get_string('nocost', 'enrol_paypal').'</p>';
        } else {

            // Calculate localised and "." cost, make sure we send PayPal the same value,
            // please note PayPal expects amount with 2 decimal places and "." separator.
            $localisedcost = format_float($cost, 2, true);
            $cost = format_float($cost, 2, false);

            if (isguestuser()) { // force login only for guest user, not real users with guest role
                $wwwroot = $CFG->wwwroot;
                echo '<div class="mdl-align"><p>'.get_string('paymentrequired').'</p>';
                echo '<p><b>'.get_string('cost').": $instance->currency $localisedcost".'</b></p>';
                echo '<p><a href="'.$wwwroot.'/login/">'.get_string('loginsite').'</a></p>';
                echo '</div>';
            } else {
                //Sanitise some fields before building the PayPal form
                $coursefullname  = format_string($course->fullname, true, array('context'=>$context));
                $courseshortname = $shortname;
                $userfullname    = fullname($USER);
                $userfirstname   = $USER->firstname;
                $userlastname    = $USER->lastname;
                $useraddress     = $USER->address;
                $usercity        = $USER->city;
                $instancename    = $this->get_instance_name($instance);

                include($CFG->dirroot.'/enrol/paypal/enrol.html');
            }

        }

        return $OUTPUT->box(ob_get_clean());
    }
149987
private static function generateEndPointPath($endpoint, $sdkId)
    {
        // Prepare message to sign
        $nonce = self::generateNonce();
        $timestamp = round(microtime(true) * 1000);

        return "{$endpoint}?nonce={$nonce}&timestamp={$timestamp}&appId={$sdkId}";
    }
117318
public function replaceChildAtBy($index, AbstractClassContent $contentSet)
    {
        $index = (isset($index) && is_int($index)) ? $index : false;
        if (is_bool($index)) {
            throw new BBException(__METHOD__.' index  parameter must be an integer');
        }
        $newContentsetArr = array();

        foreach ($this->getData() as $key => $content) {
            $contentToAdd = ($key == $index) ? $contentSet : $content;
            $newContentsetArr[] = $contentToAdd;
        }

        $this->clear();
        foreach ($newContentsetArr as $key => $content) {
            if ($content instanceof AbstractClassContent) {
                $this->push($content);
            }
        }

        return true;
    }
231277
protected function buildClass(ClassDefinition $class, $indent)
    {
        $source = <<<EOF
<?php

namespace {$class->getNamespace()};


EOF;

        $source .= (new DocBlock($class->getDocBlock(), ''))."\n";

        if ($class->isFinal()) {
            $source .= 'final ';
        } elseif ($class->isAbstract()) {
            $source .= 'abstract ';
        }

        $source .= $class->getType().' '.$class->getName();

        if ($class->getExtendsClass()) {
            $extendsClassDefinition = $class->getExtendsClassDefinition();
            if (!$extendsClassDefinition) {
                throw new \RuntimeException('Class "'.$class->getName().'" does not have a extendsClassDefinition');
            }

            $source .= ' extends '.($extendsClassDefinition->isBundled() ? '' : '\\').trim($extendsClassDefinition->getCompleteName(), '\\');
        }

        if ($implementedInterfaces = $class->getImplementedInterfaces()) {
            $interfaces = array_map(function ($val) {
                return '\\'.trim($val, '\\');
            }, $implementedInterfaces);

            $keyword = 'interface' == $class->getType() ? ' extends ' : ' implements ';
            $source .= $keyword.implode(', ', $interfaces);
        }

        $source .= PHP_EOL.'{'.PHP_EOL;

        foreach ($class->getConstants() as $constant) {
            $source .= $this->buildConstant($constant, $indent).PHP_EOL.PHP_EOL;
        }

        foreach ($class->getProperties() as $property) {
            $source .= $this->buildProperty($property, $indent).PHP_EOL.PHP_EOL;
        }

        $source .= PHP_EOL;

        foreach ($class->getMethods() as $method) {
            if ($method->isInternal()) {
                continue;
            }

            $source .= $this->buildMethod($method, 'interface' === $class->getType(), $indent)."\n\n";
        }

        return $source.'}'.PHP_EOL;
    }
667968
protected function pathinfoInternal(?string $scheme, string $path, int $options = null)
    {
        $info = $options ? \pathinfo($path, $options) : \pathinfo($path);

        if (null !== $scheme) {
            $info['scheme'] = $scheme;
            $dirname = isset($info['dirname']) && $info['dirname'] !== '.' ? $info['dirname'] : null;

            if (null !== $dirname) {
                $info['dirname'] = $scheme . '://' . $dirname;
            } else {
                $info = ['dirname' => $scheme . '://'] + $info;
            }
        }

        return $info;
    }
65278
public function removeSkillRelatedByPartId(ChildSkill $skillRelatedByPartId)
    {
        if ($this->getSkillsRelatedByPartId()->contains($skillRelatedByPartId)) { $skillPart = new ChildSkillPart();

            $skillPart->setSkillRelatedByPartId($skillRelatedByPartId);
            if ($skillRelatedByPartId->isSkillRelatedByCompositeIdsLoaded()) {
                //remove the back reference if available
                $skillRelatedByPartId->getSkillRelatedByCompositeIds()->removeObject($this);
            }

            $skillPart->setSkillRelatedByCompositeId($this);
            $this->removeComposite(clone $skillPart);
            $skillPart->clear();

            $this->collSkillsRelatedByPartId->remove($this->collSkillsRelatedByPartId->search($skillRelatedByPartId));

            if (null === $this->skillsRelatedByPartIdScheduledForDeletion) {
                $this->skillsRelatedByPartIdScheduledForDeletion = clone $this->collSkillsRelatedByPartId;
                $this->skillsRelatedByPartIdScheduledForDeletion->clear();
            }

            $this->skillsRelatedByPartIdScheduledForDeletion->push($skillRelatedByPartId);
        }


        return $this;
    }
557759
public function removeSkillRelatedByParentId(ChildSkill $skillRelatedByParentId)
    {
        if ($this->getSkillsRelatedByParentId()->contains($skillRelatedByParentId)) { $skillDependency = new ChildSkillDependency();

            $skillDependency->setSkillRelatedByParentId($skillRelatedByParentId);
            if ($skillRelatedByParentId->isSkillRelatedByDependencyIdsLoaded()) {
                //remove the back reference if available
                $skillRelatedByParentId->getSkillRelatedByDependencyIds()->removeObject($this);
            }

            $skillDependency->setSkillRelatedByDependencyId($this);
            $this->removeChild(clone $skillDependency);
            $skillDependency->clear();

            $this->collSkillsRelatedByParentId->remove($this->collSkillsRelatedByParentId->search($skillRelatedByParentId));

            if (null === $this->skillsRelatedByParentIdScheduledForDeletion) {
                $this->skillsRelatedByParentIdScheduledForDeletion = clone $this->collSkillsRelatedByParentId;
                $this->skillsRelatedByParentIdScheduledForDeletion->clear();
            }

            $this->skillsRelatedByParentIdScheduledForDeletion->push($skillRelatedByParentId);
        }


        return $this;
    }
889427
function account_education( $uid = NULL )
	{
		$params = array();
		if ($uid) {
			$this->id_format($uid);
			$params['uid'] = $uid;
		}
		return $this->oauth->get( 'account/profile/education', $params );
	}
456590
public static function toInternal(array $routeParams, $scheme = false)
    {
        if ($scheme) {
            return Yii::$app->getUrlManager()->internalCreateAbsoluteUrl($routeParams);
        }
        
        return Yii::$app->getUrlManager()->internalCreateUrl($routeParams);
    }
925556
public function getIBPTProd(
        $cnpj = '',
        $tokenIBPT = '',
        $ncm = '',
        $siglaUF = '',
        $exTarif = '0'
    ) {
        $url = "http://iws.ibpt.org.br/api/Produtos?token=$tokenIBPT&cnpj=$cnpj&codigo=$ncm&uf=$siglaUF&ex=$exTarif";
        $resposta = $this->zCommCurl($url, '', [], 80);
        $retorno = str_replace("\r\n", '|', $resposta);
        $aResp = explode('||', $retorno);
        if (! empty($aResp[1])) {
            if (substr($aResp[1], 0, 1) == '{') {
                $json = $aResp[1];

                return (array) json_decode($json, true);
            }
        }

        return [];
    }
473814
public function getInterceptedRequest()
    {
        if ($this->initialized === false) {
            $this->initialize();
        }

        $sessionDataContainer = $this->objectManager->get(SessionDataContainer::class);
        return $sessionDataContainer->getInterceptedRequest();
    }
695360
public static InternalNode<?> createInternalNode(InternalNode<?> n, Class<?> clsDataType) throws MIDDException {
        return createInternalNode(n.getID(), n.getState(), clsDataType);
    }
371261
public function getBaseClassMethods($indent, array &$result)
    {
        $id_getter_name = 'get' . Inflector::classify($this->name);
        $id_setter_name = 'set' . Inflector::classify($this->name);

        $email_getter_name = 'get' . Inflector::classify($this->getActionName() . '_by_email');
        $email_setter_name = 'set' . Inflector::classify($this->getActionName() . '_by_email');

        $name_getter_name = 'get' . Inflector::classify($this->getActionName() . '_by_name');
        $name_setter_name = 'set' . Inflector::classify($this->getActionName() . '_by_name');

        $instance_getter_name = 'get' . Inflector::classify(substr($this->name, 0, strlen($this->name) - 3));
        $instance_setter_name = 'set' . Inflector::classify(substr($this->name, 0, strlen($this->name) - 3));

        $type_hint = '\\' . UserInterface::class . '|' . $this->identified_visitor_class_name . '|' . $this->user_class_name . '|null';

        $methods = [];

        $methods[] = '/**';
        $methods[] = ' * @param  bool' . str_pad('$use_cache', strlen($type_hint) + 7, ' ', STR_PAD_LEFT);
        $methods[] = ' * @return ' . $type_hint;
        $methods[] = ' */';
        $methods[] = 'public function ' . $instance_getter_name . '($use_cache = true)';
        $methods[] = '{';
        $methods[] = '    if ($id = $this->' . $id_getter_name . '()) {';
        $methods[] = '        return $this->pool->getById(' . var_export($this->user_class_name, true). ', $id, $use_cache);';
        $methods[] = '    } elseif ($email = $this->' . $email_getter_name . '()) {';
        $methods[] = '        return new ' . $this->identified_visitor_class_name . '($this->' . $name_getter_name . '(), $email);';
        $methods[] = '    } else {';
        $methods[] = '        return null;';
        $methods[] = '    }';
        $methods[] = '}';
        $methods[] = '';

        if ($this->isRequired()) {
            $methods[] = '/**';
            $methods[] = ' * Set ' . $this->action_name . '.';
            $methods[] = ' *';
            $methods[] = ' * @param  \\' . UserInterface::class . '|' . $this->user_class_name .' $value';
            $methods[] = ' * @return $this';
            $methods[] = ' */';
            $methods[] = 'public function &' . $instance_setter_name . '(\\' . UserInterface::class . ' $value)';
            $methods[] = '{';
            $methods[] = '    if ($value instanceof ' . $this->user_class_name . ' && $value->isLoaded()) {';
            $methods[] = '        $this->' . $id_setter_name . '($value->getId());';
            $methods[] = '        $this->' . $name_setter_name . '($value->getFullName());';
            $methods[] = '        $this->' . $email_setter_name . '($value->getEmail());';
            $methods[] = '    } else {';
            $methods[] = '        throw new \InvalidArgumentException(' . var_export("Instance of '$this->user_class_name' expected", true) . ');';
            $methods[] = '    }';
            $methods[] = '';
            $methods[] = '    return $this;';
            $methods[] = '}';
        } else {
            $methods[] = '/**';
            $methods[] = ' * Set ' . $this->action_name . '.';
            $methods[] = ' *';
            $methods[] = ' * @param  ' . $type_hint . ' $value';
            $methods[] = ' * @return $this';
            $methods[] = ' */';
            $methods[] = 'public function &' . $instance_setter_name . '(\\' . UserInterface::class . ' $value = null)';
            $methods[] = '{';
            $methods[] = '    if ($value instanceof ' . $this->user_class_name . ') {';
            $methods[] = '        if ($value->isLoaded()) {';
            $methods[] = '            $this->' . $id_setter_name . '($value->getId());';
            $methods[] = '            $this->' . $name_setter_name . '($value->getFullName());';
            $methods[] = '            $this->' . $email_setter_name . '($value->getEmail());';
            $methods[] = '        } else {';
            $methods[] = '            throw new \InvalidArgumentException(' . var_export("Instance of '$this->user_class_name' expected") . ');';
            $methods[] = '        }';
            $methods[] = '    } elseif ($value instanceof ' . $this->identified_visitor_class_name . ') {';
            $methods[] = '        $this->' . $id_setter_name . '(0);';
            $methods[] = '        $this->' . $name_setter_name . '($value->getFullName());';
            $methods[] = '        $this->' . $email_setter_name . '($value->getEmail());';
            $methods[] = '    } else {';
            $methods[] = '        $this->' . $id_setter_name . '(0);';
            $methods[] = '        $this->' . $name_setter_name . '(null);';
            $methods[] = '        $this->' . $email_setter_name . '(null);';
            $methods[] = '    }';
            $methods[] = '';
            $methods[] = '    return $this;';
            $methods[] = '}';
        }

        foreach ($methods as $line) {
            if ($line) {
                $result[] = "$indent$line";
            } else {
                $result[] = '';
            }
        }
    }