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

        if ($metadata === null) {
            if (isset($this->option_metadata[$key])) {
                $metadata = $this->option_metadata[$key];
            } else {
                $metadata = array();
            }
        } else {
            if (
                isset($this->option_metadata[$key]) &&
                isset($this->option_metadata[$key][$metadata])
            ) {
                $metadata = $this->option_metadata[$key][$metadata];
            } else {
                $metadata = null;
            }
        }

        return $metadata;
    }
public function getOptionMetadata(SwatOption $option, $metadata = null)
    {
        $key = $this->getOptionMetadataKey($option);

        if ($metadata === null) {
            if (isset($this->option_metadata[$key])) {
                $metadata = $this->option_metadata[$key];
            } else {
                $metadata = array();
            }
        } else {
            if (
                isset($this->option_metadata[$key]) &&
                isset($this->option_metadata[$key][$metadata])
            ) {
                $metadata = $this->option_metadata[$key][$metadata];
            } else {
                $metadata = null;
            }
        }

        return $metadata;
    }
public function getOptionMetadata ( SwatOption $ option , $ metadata = null ) { $ key = $ this -> getOptionMetadataKey ( $ option ) ; if ( $ metadata === null ) { if ( isset ( $ this -> option_metadata [ $ key ] ) ) { $ metadata = $ this -> option_metadata [ $ key ] ; } else { $ metadata = array ( ) ; } } else { if ( isset ( $ this -> option_metadata [ $ key ] ) && isset ( $ this -> option_metadata [ $ key ] [ $ metadata ] ) ) { $ metadata = $ this -> option_metadata [ $ key ] [ $ metadata ] ; } else { $ metadata = null ; } } return $ metadata ; }
Gets 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 get the metadata.
@param string $metadata optional. An optional metadata property to get.
If not specified, all available metadata for
the option is returned.

@returns array|mixed an array of the metadata for this option, or a
specific metadata value if the <i>$metadata</i>
parameter is specified. If <i>$metadata</i> is
specified and no such metadata field exists for the
specified option, null is returned.

@see SwatOptionControl::addOptionMetadata()
Gets the metadata for an option