Entity Class ============ .. php:class:: Entity Represents an entity .. php:method:: __construct(string $name, ?string $alias = null) Create a new instance of Entity :param string $name: The entity name ..note:: *$name* must begin with an alphabetic character or an underscore, and may also contain digits and hyphens :param ?string $alias: The entity alias (default: no alias) :returns: A new instance of ``Entity`` :rtype: Entity .. php:exception:: InvalidArgumentException Thrown if *$name* is invalid .. php:method:: addAttribute(Attribute ...$attribute) Add attribute(s) to an entity :param Attribute ...$attribute: The attribute(s) to add :returns: A new instance of ``Entity`` with the attribute(s) added :rtype: Entity .. php:method:: withAttribute(Attribute ...$attribute) Set the attribute(s) of an entity :param Attribute ...$attribute: The attribute(s) :returns: A new instance of ``Entity`` with the attribute(s) :rtype: Entity