Set assign instance for this event.
@param \assign $assign
@throws \coding_exception
435562
public function set_assign(\assign $assign) {
        if ($this->is_triggered()) {
            throw new \coding_exception('set_assign() must be done before triggerring of event');
        }
        if ($assign->get_context()->id != $this->get_context()->id) {
            throw new \coding_exception('Invalid assign isntance supplied!');
        }
        if ($assign->is_blind_marking()) {
            $this->data['anonymous'] = 1;
        }
        $this->assign = $assign;
    }
1351642
public static function assign($key, $value = null) {

		if(true === is_array($key)) {
			static :: $variables = array_merge(static :: $variables, $key);
		}
		else {
			static :: $variables[$key] = $value;
		}
	}
376399
public void assignInstance(XEvent event, String instance) {
		if (instance != null && instance.trim().length() > 0) {
			XAttributeLiteral attr = (XAttributeLiteral) ATTR_INSTANCE.clone();
			attr.setValue(instance);
			event.getAttributes().put(KEY_INSTANCE, attr);
		}
	}
1246697
public function setCode($code) {
        $this->code = trim($code);
        $this->codeLength = strlen($this->code);
        return $this;
    }
193926
public function setCode(int $code)
    {
        $allowed_codes = [
            0,
            1,
            2
        ];

        if (!in_array($code, $allowed_codes)) {
            $code = 1;
        }

        $this->code = $code;
    }
412577
public function assign($var, $value = null)
    {
        if (is_string($var)) {
            $this->$var = $value;
        } elseif (is_array($var)) {
            foreach ($var as $key => $value) {
                $this->$key = $value;
            }
        }
    }
1326888
public function assign(string $property, string $key)
    {
        $this->doAssign($property, $key);

        return $this;
    }
1361656
function assign (key, token) {
  validator('tokenLabel', key)
  validator('token', token)

  tokens[key] = token
}
1332195
public function set($property, $value)
    {
        if ($this->_convert) {
            $property = str_replace( "_", "-", $property );
        } else {
            $property = str_replace( "-", "_", $property );
        }

        $this->_values[$property] = $value;
    }
734182
public function assign($name,$value=''){
        if(is_array($name)) {
            $this->tVar   =  array_merge($this->tVar,$name);
        }else {
            $this->tVar[$name] = $value;
        }
    }
1314265
public function removeFirst(&$assign = null)
    {
        $array = $this->val();

        if (count(func_get_args()) > 0) {
            $assign = $this->first()->val();
        }
        array_shift($array);

        $this->val($array);

        return $this;
    }
1221698
public static function create_from_submission(\assign $assign, \stdClass $submission) {
        $data = array(
            'context' => $assign->get_context(),
            'objectid' => $submission->id,
            'relateduserid' => ($assign->get_instance()->teamsubmission) ? null : $submission->userid,
            'other' => array(
                'newstatus' => $submission->status
            )
        );
        /** @var submission_status_updated $event */
        $event = self::create($data);
        $event->set_assign($assign);
        $event->add_record_snapshot('assign_submission', $submission);
        return $event;
    }
1164745
public function set_installer_instance(tool_installaddon_installer $installer) {
        if (is_null($this->installer)) {
            $this->installer = $installer;
        } else {
            throw new coding_exception('Attempting to reset the installer instance.');
        }
    }
639213
protected function yieldAssignmentElement(AssignmentElement $element)
    {
        foreach ($this->getOption('assignment_handlers') as $handler) {
            $iterator = $handler($element) ?: [];
            foreach ($iterator as $newElement) {
                yield $newElement;
            }
        }

        /* @var MarkupElement $markup */
        $markup = $element->getContainer();

        $arguments = [];
        foreach ($markup->getAssignmentsByName('attributes') as $attributesAssignment) {
            /* @var AssignmentElement $attributesAssignment */
            foreach ($attributesAssignment->getAttributes() as $attribute) {
                /* @var AbstractValueElement $attribute */
                $value = $attribute;
                $checked = method_exists($value, 'isChecked') && $value->isChecked();
                while (method_exists($value, 'getValue')) {
                    $value = $value->getValue();
                }
                $arguments[] = $this->formatCode($value, $checked);
            }
            $markup->removedAssignment($attributesAssignment);
        }

        $attributes = $markup->getAttributes();
        foreach ($attributes as $attribute) {
            /* @var AttributeElement $attribute */
            $arguments[] = $this->formatAttributeAsArrayItem($attribute);
        }
        $attributes->removeAll($attributes);

        foreach ($markup->getAssignments() as $assignment) {
            /* @var AssignmentElement $assignment */
            $this->throwException(
                'Unable to handle '.$assignment->getName().' assignment',
                $assignment
            );
        }

        if (count($arguments)) {
            yield $this->attributesAssignmentsFromPairs($arguments);
        }
    }
120882
public static function create_from_submission(\assign $assign, \stdClass $submission, $editable) {
        global $USER;

        $data = array(
            'context' => $assign->get_context(),
            'objectid' => $submission->id,
            'other' => array(
                'submission_editable' => $editable,
            ),
        );
        if (!empty($submission->userid) && ($submission->userid != $USER->id)) {
            $data['relateduserid'] = $submission->userid;
        }
        /** @var assessable_submitted $event */
        $event = self::create($data);
        $event->set_assign($assign);
        $event->add_record_snapshot('assign_submission', $submission);
        return $event;
    }
783849
public function assign($variable, ZephirVariable $symbolVariable, CompiledExpression $resolvedExpr, CompilationContext $compilationContext, $statement)
    {
        $codePrinter = $compilationContext->codePrinter;

        $variable = $compilationContext->symbolTable->getTempVariable('variable', $compilationContext, $statement);
        $variable->setMustInitNull(true);

        $letStatement = new LetStatement([
            'type' => 'let',
            'assignments' => [
                [
                    'assign-type' => 'variable',
                    'variable' => $variable->getName(),
                    'operator' => 'assign',
                    'expr' => [
                        'type' => $resolvedExpr->getType(),
                        'value' => $resolvedExpr->getCode(),
                        'file' => $statement['file'],
                        'line' => $statement['line'],
                        'char' => $statement['char'],
                    ],
                    'file' => $statement['file'],
                    'line' => $statement['line'],
                    'char' => $statement['char'],
                ],
            ],
        ]);
        $letStatement->compile($compilationContext);

        $symbol = $compilationContext->backend->getVariableCode($symbolVariable);
        $variable = $compilationContext->backend->getVariableCode($variable);

        $codePrinter->output('if (zephir_set_symbol('.$symbol.', '.$variable.' TSRMLS_CC) == FAILURE) {');
        $codePrinter->output("\t".'return;');
        $codePrinter->output('}');
    }
1232629
public function assign($name, $value = '')
    {
        if (is_array($name)) {
            $this->data = array_merge($this->data, $name);
        } else {
            $this->data[$name] = $value;
        }
    }