Tuesday, June 11, 2013

My answer to "Is Registry->Viewer->save() calling \Lampcms\Mongo\Doc save()?"

This is my answer to a Question on Support site for LampCMS project


Yes, Viewer is the User object.
We call it Viewer to indicate that it represents the User who is currently viewing the page. It can be logged in user or a non-logged in guest user.

The reason for calling the user "Viewer" is to differentiate it from just any registered user. For example when you viewing someone's profile or when you following/unfollowing another user we would refer to that other user as "User" but you are a "Viewer" which is also a user.

I did not invent this terminology. I first saw it on some Google's API and I liked the idea.


Anyway, a Viewer is a User and User extends MongoDoc.

If you need help in debugging something you can always add new logging line anywhere in the script.

For example
d("new password is: ".$this->newPassword);

The d() function means debug-level logging. It will work only in debug mode and only when you configured the logging (path to log) in !config.ini properly.

No comments:

Post a Comment