Swat/SwatOptionControl.php
public function addOptionMetadata(
        SwatOption $option,
        $metadata,
        $value = null
    ) {
        $key = $this->getOptionMetadataKey($option);

        if (is_array($metadata)) {
            $this->option_metadata[$key] = array_merge(
                $this->option_metadata[$key],
                $metadata
            );
        } else {
            $this->option_metadata[$key][$metadata] = $value;
        }
    }
public function addOptionMetadata(
        SwatOption $option,
        $metadata,
        $value = null
    ) {
        $key = $this->getOptionMetadataKey($option);

        if (is_array($metadata)) {
            $this->option_metadata[$key] = array_merge(
                $this->option_metadata[$key],
                $metadata
            );
        } else {
            $this->option_metadata[$key][$metadata] = $value;
        }
    }
public function addOptionMetadata ( SwatOption $ option , $ metadata , $ value = null ) { $ key = $ this -> getOptionMetadataKey ( $ option ) ; if ( is_array ( $ metadata ) ) { $ this -> option_metadata [ $ key ] = array_merge ( $ this -> option_metadata [ $ key ] , $ metadata ) ; } else { $ this -> option_metadata [ $ key ] [ $ metadata ] = $ value ; } }
Sets the metadata for an option

Any metadata may be added to options. It is up to the control to make
use of particular metadata fields. Common metadata fields are:

- classes - an array of CSS classes

@param SwatOption $option the option for which to set the metadata.
@param array|string $metadata either an array of metadata to add to the
option, or a string specifying the name
of the metadata field to add.
@param mixed $value optional. If the <i>$metadata</i> parameter is a
string, this is the metadata value to set for the
option. Otherwise, this parameter is ignored.

@see SwatOptionControl::addOption()
@see SwatOptionControl::getOptionMetadata()
Sets the metadata for an option