/** * Import information from a <user> node. * @param \DOMElement $user The user element to parse. */ protected function parse(DOMElement $user) { $this->setFormat(Format::fromCode($user->getElementsByTagName('user_format_short')->item(0)->nodeValue)); $this->setVisibility($user->getElementsByTagName('user_private')->item(0)->nodeValue); $this->setExpiry($user->getElementsByTagName('user_expiration')->item(0)->nodeValue); }
/** * Initialise properties to defaults. */ protected function __construct() { $this->setTitle('Untitled'); $this->setFormat(Format::fromCode('text')); $this->setVisibility(Visibility::VISIBILITY_PUBLIC); }