SwimmPair-Www v1.0
PHP Model of SwimmPair web application
Loading...
Searching...
No Matches
PostsManager Class Reference
Collaboration diagram for PostsManager:
Collaboration graph

Public Member Functions

 __construct (mysqli $mysqli)
 
 GetPostByID ($id)
 
 GetFollowingPost ($id)
 
 FindLastNPosts ($N)
 
 FindAllPostsOrderByIDDesc ()
 
 InsertNewCupPSAPost ($cupTitle, $cupID, $date_start, $date_end, $authorID, $clubAbbrev)
 
 InsertNewPost ($title, $content, $display_flag, $author, $signature_flag)
 
 UpdatePost ($id, $title, $content, $display_flag, $signature_flag)
 

Detailed Description

PostsManager has API functions to handle Post object/s and delivers it through web application.

Constructor & Destructor Documentation

◆ __construct()

PostsManager::__construct ( mysqli  $mysqli)

Initialize PostsManager with live database connection.

Parameters
mysqli$mysqli

Member Function Documentation

◆ FindAllPostsOrderByIDDesc()

PostsManager::FindAllPostsOrderByIDDesc ( )

Finds all posts by descending id (earliest first).

Returns
array<Post>

◆ FindLastNPosts()

PostsManager::FindLastNPosts (   $N)

Finds last N posts based on provided N.

Parameters
int$N
Returns
array<Post>

◆ GetFollowingPost()

PostsManager::GetFollowingPost (   $id)

Get following Post compared to one that we have by id.

Parameters
int$id
Returns
Post|null

◆ GetPostByID()

PostsManager::GetPostByID (   $id)

Get Post object by its id.

Parameters
int$id
Returns
Post|null

◆ InsertNewCupPSAPost()

PostsManager::InsertNewCupPSAPost (   $cupTitle,
  $cupID,
  $date_start,
  $date_end,
  $authorID,
  $clubAbbrev 
)

Post that new Cup was created as public state announcement via this function.

Parameters
string$cupTitle
int$cupID
string$date_start
string$date_end
int$authorID
string$clubAbbrev
Returns
void

◆ InsertNewPost()

PostsManager::InsertNewPost (   $title,
  $content,
  $display_flag,
  $author,
  $signature_flag 
)

Insert new news Post for visitors of web application.

Parameters
string$title
string$content
bool$display_flag
int$author
int$signature_flag
Returns
bool

◆ UpdatePost()

PostsManager::UpdatePost (   $id,
  $title,
  $content,
  $display_flag,
  $signature_flag 
)

Update already existing Post.

Parameters
int$id
string$title
string$content
int$display_flag
int$signature_flag
Returns
bool

The documentation for this class was generated from the following file: