/**
* Get a document object.
*
* Returns the global {@link \Joomla\CMS\Document\Document} object, only creating it if it doesn't already exist.
*
* @return Document object
*
* @see Document
* @since 1.7.0
* @deprecated 5.0 Load the document service from the dependency injection container or via $app->getDocument()
*/
public static function getDocument()
{
@trigger_error(sprintf('%1$s() is deprecated. Load the document from the dependency injection container or via %2$s::getApplication()->getDocument().', __METHOD__, __CLASS__), E_USER_DEPRECATED);
if (!self::$document) {
self::$document = self::createDocument();
}
return self::$document;
}