Back to MediaField class

Method __set

public void
__set
(mixed $name, mixed $value)
Method to set certain otherwise inaccessible properties of the form field object.
Parameters
  • string $name The property name for which to set the value.
  • mixed $value The value of the property.
Returns
  • void
Since
  • 3.2
Class: MediaField
Project: Joomla

Method __set - Source code

/**
 * Method to set certain otherwise inaccessible properties of the form field object.
 *
 * @param   string  $name   The property name for which to set the value.
 * @param   mixed   $value  The value of the property.
 *
 * @return  void
 *
 * @since   3.2
 */
public function __set($name, $value)
{
    switch ($name) {
        case 'authorField':
        case 'asset':
        case 'link':
        case 'width':
        case 'height':
        case 'preview':
        case 'directory':
        case 'types':
            $this->{$name} = (string) $value;
            break;
        case 'previewWidth':
        case 'previewHeight':
            $this->{$name} = (int) $value;
            break;
        default:
            parent::__set($name, $value);
    }
}