@inheritdoc

Sets attributes needed globally.
181056
public function setCredentials(array $credentials) : AuthenticatorInterface
    {
        if (array_key_exists('source', $credentials) && preg_match('/^api*/', $credentials['source'])) {
            $this->api = true;
            $this->source = $credentials['source'];
        }

        return $this;
    }
595087
public function setAttribute($name, $value = null)
    {
        if (is_array($name)) {
            foreach ($name as $key => $value) {
                $this->setAttribute($key, $value);
            }
        } else {
            $method = 'set'.ucfirst($name);
            if (method_exists($this, 'set'.ucfirst($name))) {
                $this->attributes[$name] = $this->{$method}($value);
            } else {
                $this->attributes[$name] = $value;
            }
        }

        return $this;
    }
932298
public function setRequired($required)
    {
        if (!empty($required)) {
            $this->validation[] = new Validation\Required;
        }

        $this->attributes["required"] = "";
    }
1007156
public function applyDetailSettings()
    {
        $dbLookup   = $this->util->getDbLookup();
        $localized  = $this->util->getLocalized();
        $translated = $this->util->getTranslated();

        if ($this->loginCheck) {
            $this->addLoginCheck();
        }
        $this->resetOrder();
        if ($this->has('gr2o_id_organization')) {
            $this->set('gr2o_id_organization',
                    'label', $this->_('Organization'),
                    'tab', $this->_('Identification'),
                    'multiOptions', $this->currentUser->getRespondentOrganizations()
                    );

            $this->set('gr2o_id_organization', 'default', $this->currentUser->getCurrentOrganizationId());

            if (count($this->currentUser->getAllowedOrganizations()) == 1) {
                $this->set('gr2o_id_organization', 'elementClass', 'Exhibitor');
            }
        }

        // The SSN
        if ($this->hashSsn !== self::SSN_HIDE) {
            $this->set('grs_ssn', 'label', $this->_('SSN'),
                    'tab', $this->_('Identification'));
        }

        $this->setIfExists('gr2o_patient_nr', 'label', $this->_('Respondent number'),
                'tab', $this->_('Identification'));

        $this->setIfExists('grs_initials_name',  'label', $this->_('Initials'));
        $this->setIfExists('grs_first_name',  'label', $this->_('First name'));
        $this->setIfExists('grs_surname_prefix', 'label', $this->_('Surname prefix'),
                'description', $this->_('de, ibn, Le, Mac, von, etc...'));

        $this->setIfExists('grs_last_name',   'label', $this->_('Last name'));

        $this->setIfExists('grs_partner_surname_prefix', 'label', $this->_('Partner surname prefix'),
                'description', $this->_('de, ibn, Le, Mac, von, etc...'));
        $this->setIfExists('grs_partner_last_name',   'label', $this->_('Partner last name'));

        $this->setIfExists('grs_gender',      'label', $this->_('Gender'),
                'multiOptions', $translated->getGenderHello()
                );

        $this->setIfExists('grs_birthday',    'label', $this->_('Birthday'),
                'dateFormat', \Zend_Date::DATE_MEDIUM
                );

        $this->setIfExists('gr2o_email',       'label', $this->_('E-Mail'),
                'tab', $this->_('Contact information'));
        $this->setIfExists('gr2o_mailable',   'label', $this->_('May be mailed'),
                'elementClass', 'radio',
                'separator', ' ',
                'multiOptions', $translated->getYesNo()
                );

        $this->setIfExists('gr2o_treatment',  'label', $this->_('Treatment'));
        $this->setIfExists('gr2o_comments',   'label', $this->_('Comments'));

        $this->setIfExists('grs_address_1',   'label', $this->_('Street'));
        $this->setIfExists('grs_address_2',   'label', ' ');

        // \MUtil_Echo::track($this->getItemsOrdered(), $this->getOrder('gr2o_email'));

        $this->setIfExists('grs_zipcode',     'label', $this->_('Zipcode'));
        $this->setIfExists('grs_city',        'label', $this->_('City'));
        $this->setIfExists('grs_iso_country', 'label', $this->_('Country'),
                'multiOptions', $localized->getCountries());

        $this->setIfExists('grs_phone_1',     'label', $this->_('Phone'));
        $this->setIfExists('grs_phone_2',     'label', $this->_('Phone 2'));
        $this->setIfExists('grs_phone_3',     'label', $this->_('Phone 3'));
        $this->setIfExists('grs_phone_4',     'label', $this->_('Phone 4'));

        $this->setIfExists('grs_iso_lang',    'label', $this->_('Language'),
                'multiOptions', $localized->getLanguages(),
                'tab', $this->_('Settings'), 'default', $this->project->getLocaleDefault());

        $this->setIfExists('gr2o_consent',    'label', $this->_('Consent'),
                'default', $this->util->getDefaultConsent(),
                'description', $this->_('Has the respondent signed the informed consent letter?'),
                'multiOptions', $dbLookup->getUserConsents()
                );

        $changers = $this->getChangersList();

        $this->setIfExists('gr2o_opened',     'label', $this->_('Opened'),
                'dateFormat', \Zend_Date::DATE_MEDIUM,
                'default', '',
                'elementClass', 'None',  // Has little use to show: is usually editor
                'formatFunction', array($translated, 'formatDateTime')
                );
        $this->setIfExists('gr2o_opened_by',  'label', $this->_('Opened'),
                'elementClass', 'None',  // Has little use to show: is usually editor
                'multiOptions', $changers
                );
        $this->setIfExists('gr2o_changed',    'label', $this->_('Changed on'),
                'dateFormat', \Zend_Date::DATE_MEDIUM,
                'default', '',
                'formatFunction', array($translated, 'formatDateTime')
                );
        $this->setIfExists('gr2o_changed_by', 'label', $this->_('Changed by'),
                'multiOptions', $changers
                );
        $this->setIfExists('gr2o_created',    'label', $this->_('Creation date'),
                'dateFormat', \Zend_Date::DATE_MEDIUM,
                'default', '',
                'formatFunction', array($translated, 'formatDateTime')
                );
        $this->setIfExists('gr2o_created_by', 'label', $this->_('Creation by'),
                'multiOptions', $changers
                );

        return $this;
    }
951260
public function setFrom($from)
    {
        $attr = $this->createAttribute('from');
        $this->doc->appendChild($attr);
        $attr->appendChild($this->createTextNode($from));
    }
55817
public function addMissingAttributes()
    {
        foreach ($this->getSchema() as $key => $settings) {
            if (!array_has($this->attributes, $key)) {
                array_set($this->attributes, $key, array_get($settings, 'default', null));
            }
        }
    }
766191
public function setModelAttribute($value)
    {
        if (! empty($this->filteredFieldKey)) {
            parent::setModelAttribute($value);

            $this->setModelAttributeKey($this->filteredFieldKey);
            parent::setModelAttribute(
                $this->filterValue($value)
            );
        } else {
            parent::setModelAttribute(
                $this->filterValue($value)
            );
        }
    }
185975
public function setAttributes($attributes) {
        $this->setVariable(self::ATTRIBUTES, "");
        foreach($attributes as $name => $value) {
            $this->addAttribute($name, $value);
        }
    }
1127372
public function setRequiredProperties(array $required)
    {
        if (empty($required)) {
            return $this;
        }

        if (isset($required[0]) && $required[0] === '*') {
            $this->required = get_object_vars($this);
            $this->allRequired = true;
        } else {
            $this->required = $required;
        }

        unset($this->required['required'],
              $this->required['requiredTypes'],
              $this->required['ignored'],
              $this->required['requiredParsed'],
              $this->required['allRequired']);

        return $this;
    }
267166
public function setAttribute($key, $value)
    {
        if (in_array($key, $this->getDates()))
        {
            if ($value)
            {
                $value = $this->fromDateTime($value);
            }
        }

        $this->attributes[$key] = $value;
    }
682999
public function fill($attributes)
    {
        // Some context types have varying types
        if ($this->hasGetMutator('type')) {
            $this->type = $this->mutateAttribute('type', $this->getArrValue($attributes, 'type', $this->type));
        }

        // Set properties
        $properties = array_merge([
            '@context' => 'http://schema.org',
            '@type' => $this->type,
            'sameAs' => null
        ], $this->structure, $this->extendStructure);

        // Set properties from attributes
        foreach ($properties as $key => $property) {
            $this->setProperty($key, $property, $this->getArrValue($attributes, $key, ''));
        }

        // After fill event
        $this->afterFill($attributes);
    }
295613
function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )
    {
        if ( $currentVersion != false )
        {
            $data = trim( $originalContentObjectAttribute->attribute( self::CLASS_LIST_FIELD ) );
            $contentObjectAttribute->setAttribute( self::CLASS_LIST_FIELD, $data );
        }
    }
998041
protected function setFieldOriginalValue()
    {
//        static::doNotSnakeAttributes($this->model);

        $values = $this->model->toArray();

        $this->builder->fields()->each(function (Field $field) use ($values) {
            $field->setOriginal($values);
        });
    }
74884
protected function setUnfillableAttributes(array $attributes = [])
    {
        if ( ! empty( $attributes )) {
            $keysToFill = array_diff(array_keys($attributes), $this->fillable);
            foreach ($keysToFill as $key) {
                $this->setAttribute($key, $attributes[$key]);
            }
        }
    }
136756
protected function setAttributes($options = array()) {
		if (is_array($options)) {
			foreach ($options as $attribute => $value) {
				$this->setAttribute($attribute, $value);
			}
		}
	}
759620
private function setProperties()
    {
        \danog\MadelineProto\Logger::log('Generating properties...', \danog\MadelineProto\Logger::NOTICE);
        $fixture = DocBlockFactory::createInstance();
        $class = new \ReflectionClass(APIFactory::class);
        $content = file_get_contents($filename = $class->getFileName());
        foreach ($class->getProperties() as $property) {
            if ($raw_docblock = $property->getDocComment()) {
                $docblock = $fixture->create($raw_docblock);
                if ($docblock->hasTag('internal')) {
                    $content = str_replace("\n    ".$raw_docblock."\n    public \$".$property->getName().';', '', $content);
                }
            }
        }
        foreach ($this->get_method_namespaces() as $namespace) {
            $content = preg_replace('/(class( \\w+[,]?){0,}\\n{\\n)/', '${1}'."    /**\n"."     * @internal this is a internal property generated by build_docs.php, don't change manually\n"."     *\n"."     * @var {$namespace}\n"."     */\n"."    public \${$namespace};\n", $content);
        }
        file_put_contents($filename, $content);
    }
1331957
function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )
    {
        if ( $currentVersion != false )
        {
            $xmlText = eZXMLTextType::rawXMLText( $originalContentObjectAttribute );
            $contentObjectAttribute->setAttribute( "data_text", $xmlText );
        }
        else
        {
            $parser = new eZXMLInputParser();
            $doc = $parser->createRootNode();
            $xmlText = eZXMLTextType::domString( $doc );
            $contentObjectAttribute->setAttribute( "data_text", $xmlText );
        }
    }