19declare(strict_types=1);
46 $this->internal_data =
$DIC->blog()->internal()->data();
47 $this->posting_manager =
$DIC->blog()->internal()->domain()->posting();
48 $this->blog_domain =
$DIC->blog()->internal()->domain();
49 $this->posting_gui =
$DIC->blog()->internal()->gui()->posting();
58 public function setTitle(
string $a_title): void
60 $this->title = $a_title;
80 $this->created = $a_date;
90 $this->author = $a_id;
100 $this->approved = $a_status;
114 $this->withdrawn = $a_date;
122 return $this->withdrawn;
129 bool $a_import =
false
131 $data = $this->internal_data;
139 $post =
$data->posting(
146 $this->getWithdrawn()
148 $id = $this->posting_manager->create($post);
152 parent::create($a_import);
157 bool $a_validate =
true,
158 bool $a_no_history =
false,
159 bool $a_notify =
true,
160 string $a_notify_action =
"update"
162 $data = $this->internal_data;
163 $post =
$data->posting(
170 $this->getWithdrawn()
172 $this->posting_manager->update($post);
174 $ret = parent::update($a_validate, $a_no_history);
176 if ($a_notify && $this->getActive()) {
177 $this->blog_domain->notification()->sendNotification(
179 $this->blog_node_is_wsp,
195 $query =
"SELECT * FROM il_blog_posting" .
196 " WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
197 $set =
$ilDB->query($query);
198 $rec =
$ilDB->fetchAssoc($set);
200 $this->setTitle($rec[
"title"]);
201 $this->setBlogId($rec[
"blog_id"]);
203 $this->setAuthor($rec[
"author"]);
204 if ($rec[
"approved"]) {
205 $this->setApproved(
true);
210 $this->addUpdateListener($this,
"checkApproval");
217 if (!$this->getActive() && $this->isApproved()) {
218 $this->approved =
false;
226 public function delete():
void
234 $this->getParentType()
237 $this->posting_manager->delete($this->
getId());
247 $this->setApproved(
false);
248 $this->setActive(
false);
250 $this->update(
true,
false,
false);
256 $this->getParentType()
265 bool $a_is_in_workspace =
false
267 $this->blog_node_id = $a_id;
268 $this->blog_node_is_wsp = $a_is_in_workspace;
273 $snippet = $this->posting_gui->getSnippet($this->
getId(),
true);
276 $snippet = str_replace(array(
'<br/>',
'<br />',
'</p>',
'</div>'),
"\n", $snippet);
278 return trim(strip_tags($snippet));
285 $this->lom_services->manipulate($this->getBlogId(), $this->
getId(),
"blp")
286 ->prepareDelete($this->lom_services->paths()->keywords())
287 ->prepareCreateOrUpdate($this->lom_services->paths()->keywords(), ...$keywords)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
update(bool $a_validate=true, bool $a_no_history=false, bool $a_notify=true, string $a_notify_action="update")
create(bool $a_import=false)
Create new blog posting.
getNotificationAbstract()
setApproved(bool $a_status)
setBlogNodeId(int $a_id, bool $a_is_in_workspace=false)
Set blog node id (needed for notification)
updateKeywords(array $keywords)
ILIAS Blog InternalDomainService $blog_domain
PostingManager $posting_manager
InternalDataService $internal_data
setCreated(ilDateTime $a_date)
ILIAS Blog Posting Service GUIService $posting_gui
setWithdrawn(ilDateTime $a_date)
Set last withdrawal date.
setTitle(string $a_title)
getWithdrawn()
Get last withdrawal date.
@classDescription Date and time handling
get(int $a_format, string $a_format_str='', string $a_tz='')
get formatted date
static deleteNewsOfContext(int $a_context_obj_id, string $a_context_obj_type, int $a_context_sub_obj_id=0, string $a_context_sub_obj_type="")
Delete all news of a context.
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
static now()
Return current timestamp in Y-m-d H:i:s format.