Blog_entry class.
More...
|
| $attachment |
|
| $content |
|
| $courseid = 0 |
|
| $coursemoduleid = 0 |
|
| $created |
|
| $form |
|
| $format = 1 |
|
| $groupid = 0 |
|
| $id |
|
| $lastmodified |
|
| $module = 'blog' |
|
| $moduleid = 0 |
|
| $publishstate |
|
| $rating = 0 |
|
StdClass | $renderable |
| Data needed to render the entry.
|
|
| $subject |
|
| $summary |
|
| $tags = array() |
|
| $uniquehash = '' |
|
| $userid |
|
| $usermodified |
|
Blog_entry class.
Represents an entry in a user's blog. Contains all methods for managing this entry. This class does not contain any HTML-generating code. See blog_listing sub-classes for such code. This class follows the Object Relational Mapping technique, its member variables being mapped to the fields of the post table.
@subpackage blog
- Copyright
- 2009 Nicolas Connault
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
blog_entry::__construct |
( |
|
$id = null , |
|
|
|
$params = null , |
|
|
|
$form = null |
|
) |
| |
Constructor.
If given an id, will fetch the corresponding record from the DB.
- Parameters
-
mixed | $idorparams | A blog entry id if INT, or data for a new entry if array |
◆ add()
Inserts this entry in the database.
Access control checks must be done by calling code. TODO Set the publishstate correctly
- Return values
-
◆ add_association()
blog_entry::add_association |
( |
|
$contextid, |
|
|
|
$unused = null |
|
) |
| |
Add a single association for a blog entry.
- Parameters
-
int | $contextid | - id of context to associate with the blog entry. |
string | $unused | This does nothing, do not use it. |
◆ add_associations()
blog_entry::add_associations |
( |
|
$unused = null | ) |
|
Function to add all context associations to an entry.
- Parameters
-
string | $unused | This does nothing, do not use it. |
◆ can_user_edit()
blog_entry::can_user_edit |
( |
|
$userid = null | ) |
|
User can edit a blog entry if this is their own blog entry and they have the capability moodle/blog:create, or if they have the capability moodle/blog:manageentries.
This also applies to deleting of entries.
- Parameters
-
int | $userid | Optional. If not given, $USER is used |
- Return values
-
◆ can_user_view()
blog_entry::can_user_view |
( |
|
$targetuserid | ) |
|
Checks to see if a user can view the blogs of another user.
Only blog level is checked here, the capabilities are enforced in blog/index.php
- Parameters
-
int | $targetuserid | ID of the user we are checking |
- Return values
-
◆ delete()
Deletes this entry from the database.
Access control checks must be done by calling code.
- Return values
-
◆ delete_attachments()
blog_entry::delete_attachments |
( |
| ) |
|
Deletes all the user files in the attachments area for an entry.
- Return values
-
◆ edit()
blog_entry::edit |
( |
|
$params = array() , |
|
|
|
$form = null , |
|
|
|
$summaryoptions = array() , |
|
|
|
$attachmentoptions = array() |
|
) |
| |
Updates this entry in the database.
Access control checks must be done by calling code.
- Parameters
-
array | $params | Entry parameters. |
moodleform | $form | Used for attachments. |
array | $summaryoptions | Summary options. |
array | $attachmentoptions | Attachment options. |
- Return values
-
◆ get_applicable_publish_states()
static blog_entry::get_applicable_publish_states |
( |
| ) |
|
|
static |
Use this function to retrieve a list of publish states available for the currently logged in user.
- Return values
-
array | This function returns an array ideal for sending to moodles' choose_from_menu function. |
◆ get_attachments()
blog_entry::get_attachments |
( |
| ) |
|
Gets the entry attachments list.
- Return values
-
◆ process_attachment()
blog_entry::process_attachment |
( |
|
$form | ) |
|
Inserts this entry in the database.
Access control checks must be done by calling code.
- Parameters
-
mform | $form | Used for attachments |
- Return values
-
◆ remove_associations()
blog_entry::remove_associations |
( |
| ) |
|
remove all associations for a blog entry
- Return values
-
The documentation for this class was generated from the following file: