Object variables
RainLab\Blog\Models\Post
| ||
---|---|---|
filterFields() | method | Limit visibility of the published-button |
"___METHOD___|filterFields()"
|
||
afterValidate() | method | |
"___METHOD___|afterValidate()"
|
||
beforeSave() | method | |
"___METHOD___|beforeSave()"
|
||
setUrl() | method | Sets the "url" attribute with a URL to this object |
"___METHOD___|setUrl()"
|
||
canEdit() | method | Used to test if a certain user has permission to edit post, returns TRUE if the user is the owner or has other posts access. |
"___METHOD___|canEdit()"
|
||
formatHtml() | method | |
"___METHOD___|formatHtml()"
|
||
scopeIsPublished() | method | |
"___METHOD___|scopeIsPublished()"
|
||
scopeListFrontEnd() | method | Lists posts for the front end |
"___METHOD___|scopeListFrontEnd()"
|
||
scopeFilterCategories() | method | Allows filtering for specifc categories |
"___METHOD___|scopeFilterCategories()"
|
||
getHasSummaryAttribute() | method | Used by "has_summary", returns true if this post uses a summary (more tag) |
"___METHOD___|getHasSummaryAttribute()"
|
||
getSummaryAttribute() | method | Used by "summary", if no excerpt is provided, generate one from the content. Returns the HTML content before the tag or a limited 600 character version. |
"___METHOD___|getSummaryAttribute()"
|
||
scopeApplySibling() | method | Apply a constraint to the query to find the nearest sibling // Get the next post Post::applySibling()->first(); // Get the previous post Post::applySibling(-1)->first(); // Get the previous post, ordered by the ID attribute instead Post::applySibling(['direction' => -1, 'attribute' => 'id'])->first(); |
"___METHOD___|scopeApplySibling()"
|
||
nextPost() | method | Returns the next post, if available. |
"___METHOD___|nextPost()"
|
||
previousPost() | method | Returns the previous post, if available. |
"___METHOD___|previousPost()"
|
||
getMenuTypeInfo() | method | Handler for the pages.menuitem.getTypeInfo event. Returns a menu item type information. The type information is returned as array with the following elements: - references - a list of the item type reference options. The options are returned in the ["key"] => "title" format for options that don't have sub-options, and in the format ["key"] => ["title"=>"Option title", "items"=>[...]] for options that have sub-options. Optional, required only if the menu item type requires references. - nesting - Boolean value indicating whether the item type supports nested items. Optional, false if omitted. - dynamicItems - Boolean value indicating whether the item type could generate new menu items. Optional, false if omitted. - cmsPages - a list of CMS pages (objects of the Cms\Classes\Page class), if the item type requires a CMS page reference to resolve the item URL. |
"___METHOD___|getMenuTypeInfo()"
|
||
resolveMenuItem() | method | Handler for the pages.menuitem.resolveItem event. Returns information about a menu item. The result is an array with the following keys: - url - the menu item URL. Not required for menu item types that return all available records. The URL should be returned relative to the website root and include the subdirectory, if any. Use the Url::to() helper to generate the URLs. - isActive - determines whether the menu item is active. Not required for menu item types that return all available records. - items - an array of arrays with the same keys (url, isActive, items) + the title key. The items array should be added only if the $item's $nesting property value is TRUE. |
"___METHOD___|resolveMenuItem()"
|
||
bootValidation() | method | Boot the validation trait for this model. |
"___METHOD___|bootValidation()"
|
||
forceSave() | method | Force save the model even if validation fails. |
"___METHOD___|forceSave()"
|
||
validate() | method | Validate the model instance |
"___METHOD___|validate()"
|
||
isAttributeRequired() | method | Determines if an attribute is required based on the validation rules. |
"___METHOD___|isAttributeRequired()"
|
||
errors() | method | Get validation error message collection for the Model |
"___METHOD___|errors()"
|
||
validating() | method | Create a new native event for handling beforeValidate(). |
"___METHOD___|validating()"
|
||
validated() | method | Create a new native event for handling afterValidate(). |
"___METHOD___|validated()"
|
||
table | string | |
"rainlab_blog_posts"
|
||
implement | array(1) | |
array:1 [ 0 => "@RainLab.Translate.Behaviors.TranslatableModel" ] |
||
rules | array(4) | |
array:4 [ "title" => "required" "slug" => array:3 [ 0 => "required" 1 => "regex:/^[a-z0-9\/\:_\-\*\[\]\+\?\|]*$/i" 2 => "unique:rainlab_blog_posts" ] "content" => "required" "excerpt" => "" ] |
||
translatable | array(5) | |
array:5 [ 0 => "title" 1 => "content" 2 => "content_html" 3 => "excerpt" 4 => array:2 [ 0 => "slug" "index" => true ] ] |
||
belongsTo | array(1) | |
array:1 [ "user" => array:1 [ 0 => "Backend\Models\User" ] ] |
||
belongsToMany | array(1) | |
array:1 [ "categories" => array:3 [ 0 => "RainLab\Blog\Models\Category" "table" => "rainlab_blog_posts_categories" "order" => "name" ] ] |
||
attachMany | array(2) | |
array:2 [ "featured_images" => array:2 [ 0 => "System\Models\File" "order" => "sort_order" ] "content_images" => array:1 [ 0 => "System\Models\File" ] ] |
||
preview | NULL | |
null
|
Object variables
RainLab\Blog\Models\Post
| ||
---|---|---|
filterFields() | method | Limit visibility of the published-button |
"___METHOD___|filterFields()"
|
||
afterValidate() | method | |
"___METHOD___|afterValidate()"
|
||
beforeSave() | method | |
"___METHOD___|beforeSave()"
|
||
setUrl() | method | Sets the "url" attribute with a URL to this object |
"___METHOD___|setUrl()"
|
||
canEdit() | method | Used to test if a certain user has permission to edit post, returns TRUE if the user is the owner or has other posts access. |
"___METHOD___|canEdit()"
|
||
formatHtml() | method | |
"___METHOD___|formatHtml()"
|
||
scopeIsPublished() | method | |
"___METHOD___|scopeIsPublished()"
|
||
scopeListFrontEnd() | method | Lists posts for the front end |
"___METHOD___|scopeListFrontEnd()"
|
||
scopeFilterCategories() | method | Allows filtering for specifc categories |
"___METHOD___|scopeFilterCategories()"
|
||
getHasSummaryAttribute() | method | Used by "has_summary", returns true if this post uses a summary (more tag) |
"___METHOD___|getHasSummaryAttribute()"
|
||
getSummaryAttribute() | method | Used by "summary", if no excerpt is provided, generate one from the content. Returns the HTML content before the tag or a limited 600 character version. |
"___METHOD___|getSummaryAttribute()"
|
||
scopeApplySibling() | method | Apply a constraint to the query to find the nearest sibling // Get the next post Post::applySibling()->first(); // Get the previous post Post::applySibling(-1)->first(); // Get the previous post, ordered by the ID attribute instead Post::applySibling(['direction' => -1, 'attribute' => 'id'])->first(); |
"___METHOD___|scopeApplySibling()"
|
||
nextPost() | method | Returns the next post, if available. |
"___METHOD___|nextPost()"
|
||
previousPost() | method | Returns the previous post, if available. |
"___METHOD___|previousPost()"
|
||
getMenuTypeInfo() | method | Handler for the pages.menuitem.getTypeInfo event. Returns a menu item type information. The type information is returned as array with the following elements: - references - a list of the item type reference options. The options are returned in the ["key"] => "title" format for options that don't have sub-options, and in the format ["key"] => ["title"=>"Option title", "items"=>[...]] for options that have sub-options. Optional, required only if the menu item type requires references. - nesting - Boolean value indicating whether the item type supports nested items. Optional, false if omitted. - dynamicItems - Boolean value indicating whether the item type could generate new menu items. Optional, false if omitted. - cmsPages - a list of CMS pages (objects of the Cms\Classes\Page class), if the item type requires a CMS page reference to resolve the item URL. |
"___METHOD___|getMenuTypeInfo()"
|
||
resolveMenuItem() | method | Handler for the pages.menuitem.resolveItem event. Returns information about a menu item. The result is an array with the following keys: - url - the menu item URL. Not required for menu item types that return all available records. The URL should be returned relative to the website root and include the subdirectory, if any. Use the Url::to() helper to generate the URLs. - isActive - determines whether the menu item is active. Not required for menu item types that return all available records. - items - an array of arrays with the same keys (url, isActive, items) + the title key. The items array should be added only if the $item's $nesting property value is TRUE. |
"___METHOD___|resolveMenuItem()"
|
||
bootValidation() | method | Boot the validation trait for this model. |
"___METHOD___|bootValidation()"
|
||
forceSave() | method | Force save the model even if validation fails. |
"___METHOD___|forceSave()"
|
||
validate() | method | Validate the model instance |
"___METHOD___|validate()"
|
||
isAttributeRequired() | method | Determines if an attribute is required based on the validation rules. |
"___METHOD___|isAttributeRequired()"
|
||
errors() | method | Get validation error message collection for the Model |
"___METHOD___|errors()"
|
||
validating() | method | Create a new native event for handling beforeValidate(). |
"___METHOD___|validating()"
|
||
validated() | method | Create a new native event for handling afterValidate(). |
"___METHOD___|validated()"
|
||
table | string | |
"rainlab_blog_posts"
|
||
implement | array(1) | |
array:1 [ 0 => "@RainLab.Translate.Behaviors.TranslatableModel" ] |
||
rules | array(4) | |
array:4 [ "title" => "required" "slug" => array:3 [ 0 => "required" 1 => "regex:/^[a-z0-9\/\:_\-\*\[\]\+\?\|]*$/i" 2 => "unique:rainlab_blog_posts" ] "content" => "required" "excerpt" => "" ] |
||
translatable | array(5) | |
array:5 [ 0 => "title" 1 => "content" 2 => "content_html" 3 => "excerpt" 4 => array:2 [ 0 => "slug" "index" => true ] ] |
||
belongsTo | array(1) | |
array:1 [ "user" => array:1 [ 0 => "Backend\Models\User" ] ] |
||
belongsToMany | array(1) | |
array:1 [ "categories" => array:3 [ 0 => "RainLab\Blog\Models\Category" "table" => "rainlab_blog_posts_categories" "order" => "name" ] ] |
||
attachMany | array(2) | |
array:2 [ "featured_images" => array:2 [ 0 => "System\Models\File" "order" => "sort_order" ] "content_images" => array:1 [ 0 => "System\Models\File" ] ] |
||
preview | NULL | |