flatpage/flatpage.php
The flatpage model
- Author
- abidibo
- Copyright
- 2011 Otto srl
- License
- MIT license
- Package
- jeff-flatpage
- Version
- 1.21
\flatpage
The flatpage model class
Inherits from jeff model class.
This class defines the flatpage fields and provides a method to retrieve an object from a slug (url request)
Model fields:
- int id: page identifier
- string date: page date
- string title: page title
- string slug: url query string
- string subtitle: page subtitle
- string abstract: page abstract
- string text: page text
- string image1: first image filename
- string image2: second image filename
- string video1: first video url code (youtube)
- string video2: second video url code (youtube)
- string groups: comma separated list of system group ids who may access the content. If empty the content is visible to everyone.
- Parent(s)
- \model
- Author
- abidibo
- Copyright
- 2011 Otto srl
- License
- MIT license
- Uses
- \model
- Version
- 1.21
Methods
__construct(
\registry $registry, int $id
)
:
void
flatpage model constructor
Name | Type | Description |
---|---|---|
$registry | \registry | |
$id | int |
- Access
- public
getFromSlug(
\registry $registry, string $slug
)
:
mixed
Get flatpage object from slug
Perform an sql select statement to retrieve page data from given slug.
Return a model instance if the slug is found, null otherwise
Name | Type | Description |
---|---|---|
$registry | \registry | |
$slug | string | the slug taken from the query string |
Type | Description |
---|---|
mixed | returns the flatpage object if found, null otherwise |
- Access
- public
- Static