Object Attributes

Chyrp Lite's Model class provides a powerful data model for objects that are constructed using SQL data. Below is a list of attributes for Post, Page, User, Group, Category, View, Like, Pingback, and Comment objects. These attributes are accessible from PHP using the -> operator and from Twig using the . operator.

Post

AttributeRequiresDescription
no_resultstrue if the object represents a database query that returned nothing.
featherName of the feather responsible for rendering this blog post.
idNumeric ID for this blog post.
created_atTimestamp for the creation of this blog post.
updated_atTimestamp for the most recent update of this blog post.
urlThe unique URL identifier (slug) for this blog post.
slugSynonym for url.
previousThe previous blog post in chronological order.
nextThe next blog post in chronological order.
userThe user who created this post.
categoryCategorizeThe category this post belongs to.
viewsPost ViewsThe view count for this post.
likesLikesAn array of likes added to this post.
like_countLikesA count of the likes added to this post.
like_linkLikesHTML fragment for a like/unlike link.
pingbacksPingableAn array of pingbacks to this post.
pingback_countPingableA count of the pingbacks for this post.
commentsCommentsAn array of comments on this post.
comment_countCommentsA count of the comments for this post.
latest_commentCommentsThe timestamp of the latest comment on this post.
commentableCommentstrue if the current visitor can comment on this post.

Page

AttributeRequiresDescription
no_resultstrue if the object represents a database query that returned nothing.
idUnique identifier for this page.
created_atTimestamp for the creation of this page.
updated_atTimestamp for the most recent update of this page.
urlThe unique URL identifier (slug) for this page.
slugSynonym for url.
titleTitle of this page.
publicCan the page be viewed without permission?
show_in_listShould this page be included in the pages list?
childrenAn array of pages that are children of this page.
parentThe parent page of this page.
userThe user who created this page.

User

AttributeRequiresDescription
no_resultstrue if the object represents a database query that returned nothing.
groupThe group this user belongs to.
postsAn array of posts created by this user.
pagesAn array of pages created by this user.
likesLikesAn array of likes added by this user.
like_countLikesA count of the likes added by this user.
viewsPost ViewsAn array of post viewings by this user.
view_countPost ViewsA count of post viewings by this user.
commentsCommentsAn array of comments made by this user.
comment_countCommentsA count of the comments made by this user.

Visitor

AttributeRequiresDescription
idThe numeric ID of this user - zero if not logged in.
logged intrue if the visitor is logged in.
likesLikesAn array of likes added by this visitor.
like_countLikesA count of the likes added by this visitor.
commentsCommentsAn array of comments made by this visitor.
comment_countCommentsA count of the comments made by this visitor.

Group

AttributeRequiresDescription
no_resultstrue if the object represents a database query that returned nothing.
usersAn array of users belonging to this group.

Category

AttributeRequiresDescription
no_resultsCategorizetrue if the object represents a database query that returned nothing.
idCategorizeThe numeric ID of this category.
nameCategorizeThe category name.
cleanCategorizeThe URL-friendly name.
show_on_homeCategorizetrue if the category can be listed on the homepage.
urlCategorizeThe absolute URL[note] for this category listing.
post_countCategorizeThe number of posts belonging to this category.

View

AttributeRequiresDescription
no_resultsPost Viewstrue if the object represents a database query that returned nothing.
idPost ViewsThe numeric ID of this view.
post_idPost ViewsThe ID of the post that was viewed.
user_idPost ViewsThe ID of the user who viewed the post - zero if not logged in.
created_atPost ViewsTimestamp for the viewing.

Like

AttributeRequiresDescription
no_resultsLikestrue if the object represents a database query that returned nothing.
idLikesThe numeric ID of this like.
post_idLikesThe ID of the post that was liked.
user_idLikesThe ID of the user who liked the post - zero if not logged in.
timestampLikesTimestamp for the viewing.
session_hashLikesA hash identifying this user and session combination.

Pingback

AttributeRequiresDescription
no_resultsPingabletrue if the object represents a database query that returned nothing.
idPingableThe numeric ID of this pingback.
post_idPingableThe ID of the post that was mentioned.
sourcePingableThe URL of the source that mentioned the post.
titlePingableA title identifying the source.
created_atPingableTimestamp for the creation of this pingback.

Comment

AttributeRequiresDescription
no_resultsCommentstrue if the object represents a database query that returned nothing.
idCommentsThe numeric ID of this comment.
bodyCommentsThe comment text.
authorCommentsThe name of this comment's author.
author_urlCommentsThe URL of this comment's author.
author_emailCommentsThe email address of the author.
ipCommentsCRC-24 hash of the commenter's IP address.
agentCommentsUser agent string from the commenter's browser.
statusCommentsStatus of the comment: approved, denied, spam, or pingback.
post_idCommentsThe ID of the post that was mentioned.
user_idCommentsThe ID of the user who commented - zero if not logged in.
created_atCommentsTimestamp for the creation of this comment.
updated_atCommentsTimestamp for the most recent update of this comment.