Back to JsonApiView class

Method __construct

public
__construct
(mixed $config = [])
Constructor.
Parameters
  • array $config A named configuration array for object construction. contentType: the name (optional) of the content type to use for the serialization
Since
  • 4.0.0
Class: JsonApiView
Project: Joomla

Method __construct - Source code

/**
 * Constructor.
 *
 * @param   array  $config  A named configuration array for object construction.
 *                          contentType: the name (optional) of the content type to use for the serialization
 *
 * @since   4.0.0
 */
public function __construct($config = [])
{
    if (\array_key_exists('contentType', $config)) {
        $this->type = $config['contentType'];
    }
    if ($this->serializer === null) {
        $this->serializer = new JoomlaSerializer($this->type);
    }
    parent::__construct($config);
}