Prev | Current Page 228 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

now().getTime()-publishedOn.getTime())/86400000;
return if(daysOnline < 1)
???Published Today???;
else if(daysOnline < 2)
???Published Yesterday???;
else if(daysOnline < 7)
???Published ??? + Math.floor(daysOnline) + ??? days ago???;
else
???Published on ??? + DateTools.format(publishedOn, ???%Y-%m-%d???);
}
}
}
When the private variable publishedOn is set to null , the entry is not yet ready to be published and it
is still a draft, as soon as the publish() method is invoked its value is set to the current date and, thus,
ready to be displayed. The method isOnline() is used to check whether the entry has been published
or not, while getOnlineInfo() returns information, in a human readable form, on the elapsed time
since the date of publication.
Variable Value Modifiers
Class variables supports value modifiers, or properties, that permits to alter their standard behavior
as follows:
The access to the variable value can be limited to read - only or write - only.
A getter and/or setter method can be declared to access the variable value.


Pages:
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240