Dotclear 2.24
Loading...
Searching...
No Matches
dcPostMedia Class Reference

Public Member Functions

 __construct ()
 
 getPostMedia (array $params=[])
 
 addPostMedia (int $post_id, int $media_id, string $link_type='attachment')
 
 removePostMedia (int $post_id, int $media_id, ?string $link_type=null)
 

Data Fields

const POST_MEDIA_TABLE_NAME = 'post_media'
 

Protected Attributes

 $con
 
 $table
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Constructs a new instance.

References dcCore\app(), and POST_MEDIA_TABLE_NAME.

Member Function Documentation

◆ getPostMedia()

getPostMedia ( array  $params = [])

Returns media items attached to a blog post.

Parameters
array$paramsThe parameters
Returns
dcRecord The post media.

References dcCore\app(), and dcMedia\MEDIA_TABLE_NAME.

Referenced by addPostMedia().

◆ addPostMedia()

addPostMedia ( int  $post_id,
int  $media_id,
string  $link_type = 'attachment' 
)

Attaches a media to a post.

Parameters
int$post_idThe post identifier
int$media_idThe media identifier
string$link_typeThe link type (default: attachment)

References dcCore\app(), and getPostMedia().

◆ removePostMedia()

removePostMedia ( int  $post_id,
int  $media_id,
?string  $link_type = null 
)

Detaches a media from a post.

Parameters
int$post_idThe post identifier
int$media_idThe media identifier
string$link_typeThe link type

References dcCore\app().

Field Documentation

◆ POST_MEDIA_TABLE_NAME

const POST_MEDIA_TABLE_NAME = 'post_media'

◆ $con

$con
protected

◆ $table

$table
protected

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