Task ==== .. php:class:: Task Represents a Task in a Gantt chart .. php:method:: __construct(string $title, string $enduration, ?string $id = null) Create a new Task :param string $title: Task title :param string $enduration: Task end or duration Can be: * A date in the chart input date format (see :php:meth:`GanttChart::withDateFormat`) * A duration in the form *nt* where *n* is an integer and *t* is a letter indicating the duration unit, e.g. *d* for *days* * A string in the form *until id* where *id* is the id of the task or milestone that this task should end at .. warning:: Multiple ids are not supported :param ?string $id: Task id (default: no id) .. note:: A task with an id *must* also have its start set. See :php:meth:`withStart` :returns: A new ``Task`` instance :rtype: Task .. php:method:: withComment(string $comment) Set a comment for the Task :param string $comment: The comment :returns: A new ``Task`` instance :rtype: Task .. php:method:: withInteraction(string $interaction, InteractionType $type, ?string $tooltip = null, InteractionTarget $target = InteractionTarget::Self) Set an interaction .. note:: A task *must* have an id, and so *must* have its start set, if it is to have an interaction. :param string $interaction: Interaction text :param InteractionType $type: Interaction type; callback or link :param ?string $tooltip: Tooltip text (default: no tooltip) :param InteractionTarget $target: Interaction target (default: current window) :returns: A new ``Task`` instance with the interaction :rtype: Task .. php:method:: withStart(string $start): self Sets the start date of the task The default (this method not called) is for the task to start immediately after the preceding task :param string $start: Task start Can be: * A date in the chart input date format (see :php:meth:`GanttChart::withDateFormat`) * A string in the form *after id* where *id* is the id of the task or milestone after which this task should start .. warning:: Multiple ids are not supported :returns: A new ``Task`` instance :rtype: Task .. php:method:: withTag(Tag ...$tag) Set task status tag(s) :param Tag ...$tag: The tag(s) :returns: A new ``Task`` instance with the tag(s) :rtype: Task