\Symfony\Component\HttpFoundationAcceptHeaderItem

Represents an Accept-* header item.

Summary

Methods
Properties
Constants
__construct()
fromString()
__toString()
setValue()
getValue()
setQuality()
getQuality()
setIndex()
getIndex()
hasAttribute()
getAttribute()
getAttributes()
setAttribute()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$value
$quality
$index
$attributes
N/A

Properties

$value

$value : 

Type

$quality

$quality : 

Type

$index

$index : 

Type

$attributes

$attributes : 

Type

Methods

__construct()

__construct(string  $value, array  $attributes = array()) 

Parameters

string $value
array $attributes

fromString()

fromString(string  $itemValue) : self

Builds an AcceptHeaderInstance instance from a string.

Parameters

string $itemValue

Returns

self

__toString()

__toString() : string

Returns header value's string representation.

Returns

string

setValue()

setValue(string  $value) : $this

Set the item value.

Parameters

string $value

Returns

$this

getValue()

getValue() : string

Returns the item value.

Returns

string

setQuality()

setQuality(float  $quality) : $this

Set the item quality.

Parameters

float $quality

Returns

$this

getQuality()

getQuality() : float

Returns the item quality.

Returns

float

setIndex()

setIndex(integer  $index) : $this

Set the item index.

Parameters

integer $index

Returns

$this

getIndex()

getIndex() : integer

Returns the item index.

Returns

integer

hasAttribute()

hasAttribute(string  $name) : boolean

Tests if an attribute exists.

Parameters

string $name

Returns

boolean

getAttribute()

getAttribute(string  $name, mixed  $default = null) : mixed

Returns an attribute by its name.

Parameters

string $name
mixed $default

Returns

mixed

getAttributes()

getAttributes() : array

Returns all attributes.

Returns

array

setAttribute()

setAttribute(string  $name, string  $value) : $this

Set an attribute.

Parameters

string $name
string $value

Returns

$this