You must provide a setter method for every attribute you want to set from the
XML build file. It is good practice to also provide a getter method, but in
practice you can decide how your tasks will use your task. In the example above,
we've provided a getter method for each attribute and we've also provided an
additional method:DSN::getPEARDSN()
which returns the DSN
hash array used by PEAR::DB
, PEAR::MDB
,
and Creole. Depending on the needs of the Tasks using this DataType, we may only
wish to provide the getPEARDSN()
method rather than a getter
for each attribute.
Also important to note is that the getter method needs to check to see whether
the current DataType is a reference to a previously defined DataType -- the
DataType::isReference()
exists for this purpose. For this
reason, the getter methods need to be called with the current project, because
References are stored relative to a project.