Put attributes for accounting.

Here we put some accounting values. There many more attributes for accounting,
but for web-applications only certain attributes make sense.
@return void
348942
function putAuthAttributes()
    {
        $this->putAttribute(RADIUS_ACCT_SESSION_ID, $this->session_id);
        $this->putAttribute(RADIUS_ACCT_STATUS_TYPE, $this->status_type);
        if (isset($this->session_time) && $this->status_type == RADIUS_STOP) {
            $this->putAttribute(RADIUS_ACCT_SESSION_TIME, $this->session_time);
        }
        if (isset($this->authentic)) {
            $this->putAttribute(RADIUS_ACCT_AUTHENTIC, $this->authentic);
        }

    }
499725
protected function autoAssignAttributes()
    {
        $attributes = isset($this->defaultAttributes) ? $this->defaultAttributes : [];
        // Default attributes are not counted as "from storage"
        $this->fillAttributes($attributes, false);
    }
1213760
public function setAttributes($values)
    {
        if (!is_array($values)) {
            return;
        }
        foreach ($values as $name => $value) {
            $this->$name = $value;
        }
    }
882208
private function applyAttributes($attributes)
    {
        if (array_key_exists('count', $attributes) && $attributes['count'] > 0) {
            $keys = array_keys($attributes);

            foreach ($keys as $key) {
                if (is_array($attributes[$key]) && array_key_exists(0, $attributes[$key])) {
                    // If the entry has multiple attributes, we'll make sure we loop through each one
                    if (array_key_exists('count', $attributes[$key]) && $attributes[$key]['count'] > 1) {
                        $data = [];

                        for ($i = 0; $i <= $attributes[$key]['count']; $i++) {
                            $data[] = $attributes[$key][$i];
                        }

                        $this->setAttribute($key, array_filter($data));
                    } else {
                        // Looks like only one attribute exists, let's set it
                        $this->setAttribute($key, $attributes[$key][0]);
                    }
                }
            }

            $this->applyExtraAttributes();
        }
    }
312590
public function setAttribute($attribute)
    {
        if (strpos($attribute, '.') !== false) {
            $pieces = explode('.', $attribute, 2);
            $this->setAlias($pieces[0]);
            $attribute = $pieces[1];
        // If an alias was already set then this must be set back to null.
        } else {
            $this->alias = null;
        }
        $this->attribute = $attribute;
    }
948786
private void registerMandatoryAttributes(Attributes attributes) {
    // see https://sourceforge.net/p/jerichohtml/discussion/350024/thread/501a7d05/
    Map<String, String> attrs = context.getMandatoryAttributes();
    if (!attrs.isEmpty()) {
      for (Entry<String, String> i : attrs.entrySet()) {
        String v = i.getValue();
        if (v == null) {
          outputDocument.insert(attributes.getBegin(), " " + i.getKey() + " ");
        } else {
          outputDocument.insert(attributes.getBegin(), " " + i.getKey() + "\"" + v + "\" ");
        }
      }
    }
  }
131974
public function putStandardAttributes()
    {
        if (!$this->useStandardAttributes) {
            return;
        }

        if (isset($_SERVER)) {
            $var = $_SERVER;
        } else {
            $var = $GLOBALS['HTTP_SERVER_VARS'];
        }

        $this->putAttribute(RADIUS_NAS_IDENTIFIER, isset($var['HTTP_HOST']) ? $var['HTTP_HOST'] : 'localhost');
        $this->putAttribute(RADIUS_NAS_PORT_TYPE, RADIUS_VIRTUAL);
        $this->putAttribute(RADIUS_SERVICE_TYPE, RADIUS_FRAMED);
        $this->putAttribute(RADIUS_FRAMED_PROTOCOL, RADIUS_PPP);
        $this->putAttribute(RADIUS_CALLING_STATION_ID, isset($var['REMOTE_HOST']) ? $var['REMOTE_HOST'] : '127.0.0.1');
    }
547875
public function addAttributes(array $attributes)
    {
        foreach ($attributes as $key => $value) {
            $this->addAttribute($key, $value);
        }
    }
986811
public function set_attributes() {

		$this->attributes += array(
			'data-modal'   => $this->id(),
			'data-content' => '#' . $this->id() . '-tmpl',
			'data-margin'  => 12,
			'data-element' => 'form',
			'data-width'   => '480',
			'data-height'  => '550',
			'class'        => 'button',
		);
		$this->set_modal_size();
		$this->set_modal_config();
		if ( ! empty( $this->struct['description'] ) ) {
			$this->attributes['data-title'] = $this->struct['description'];
			unset( $this->struct['description'] );
		}
		if ( ! empty( $this->struct['attributes'] ) ) {
			$this->attributes = array_merge( $this->attributes, $this->struct['attributes'] );
		}
	}
8792
public function setAttribute($attribute, $value){
        if($attribute === 'table'){
            $this->_table = $value;
        }
        elseif($attribute === 'pk'){
            $this->_pk = $value;
        }
        elseif($attribute === 'relations'){
            $this->_relations = $value;
        }
        
        return $this;
    }
748071
public function addAttributes($arrAttributes) {
        foreach ($arrAttributes as $key => $val) {
            $this->attributes[$key] = $val;
        }
    }
1310162
function addField( $attributes ) {
		// check we're in a valid row
		if( !isset( $this->row ) || !isset( $this->data[$this->row] ) ) {
			return;
		}

		// Set the field index so we know where we are
		if( isset( $attributes['NAME'] ) ) {
			$this->current_field = $this->FieldID( $attributes['NAME'] );
		} else {
			$this->current_field = count( $this->data[$this->row] );
		}

		// initialise data
		if( !isset( $this->data[$this->row][$this->current_field] ) ) {
			$this->data[$this->row][$this->current_field] = '';
		}
	}
660400
public function saveAttribute()
    {
        $language = current($this->getLanguages());
        if ($language !== Yii::$app->language) {
            $this->identity->{$this->languageAttribute} = Yii::$app->language;
            $this->identity->save(true, [$this->languageAttribute]);
        }
    }
114323
public function encryptAttributes()
    {
        foreach ($this->getEncryptable() as $attribute) {
            $this->setEncryptingAttribute($attribute, array_get($this->attributes, $attribute));
        }
    }
854662
protected function prepareAllAttributes() {
    static::$all_attributes = static::$my_attributes;
    $parent = get_class($this);
    while (($parent = get_parent_class($parent)) != 'Palmabit\Library\Models\SingleTableInheritance') {
      static::$all_attributes = array_merge(static::$all_attributes, $parent::$my_attributes);
    }
  }
906297
protected function setDefaultAttributes()
    {
        if (!empty($this->attributes)) {
            foreach ($this->attributes as $attr => $val) {
                $this->realSetAttribute($attr, $val);
            }
        }
    }
771130
public function updateAttributes(&$attributes)
    {
        $attributes['data-calendar-config']  = $this->owner->getCalendarConfigJSON();
        $attributes['data-calendar-enabled'] = $this->owner->getCalendarEnabled();
    }