ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilNewsData.php
Go to the documentation of this file.
1
<?
php
2
3
/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
4
11
class
ilNewsData
12
{
16
protected
$_deps
;
17
21
protected
$service
;
22
26
public
function
__construct
(
ilNewsService
$service
,
$_deps
)
27
{
28
$this->service =
$service
;
29
$this->_deps =
$_deps
;
30
}
31
38
public
function
save
(
ilNewsItem
$news_item) : int
39
{
40
if
($news_item->
getId
() > 0) {
41
$news_item->
update
(
true
);
42
}
else
{
43
$news_item->
create
();
44
}
45
return
$news_item->
getId
();
46
}
47
54
public
function
getNewsOfContext
(
ilNewsContext
$context
) : array
55
{
56
return
ilNewsItem::getNewsOfContext
(
57
$context->
getObjId
(),
58
$context->
getObjType
(),
59
$context->
getSubId
(),
60
$context->
getSubType
()
61
);
62
}
63
68
public
function
delete
(
ilNewsItem
$news_item)
69
{
70
$news_item->delete();
71
}
72
}
ilNewsContext
Definition:
class.ilNewsContext.php:11
$context
$context
Definition:
webdav.php:25
ilNewsContext\getObjId
getObjId()
Get Obj Id.
Definition:
class.ilNewsContext.php:49
ilNewsData
News data.
Definition:
class.ilNewsData.php:11
ilNewsData\save
save(ilNewsItem $news_item)
Save news item.
Definition:
class.ilNewsData.php:38
ilNewsData\getNewsOfContext
getNewsOfContext(ilNewsContext $context)
Get news of context.
Definition:
class.ilNewsData.php:54
ilNewsData\$service
$service
Definition:
class.ilNewsData.php:21
ilNewsService
News service.
Definition:
class.ilNewsService.php:11
ilNewsContext\getSubId
getSubId()
Get Sub Obj Id.
Definition:
class.ilNewsContext.php:69
ilNewsItem\getId
getId()
Get Id.
Definition:
class.ilNewsItem.php:136
ilNewsData\__construct
__construct(ilNewsService $service, $_deps)
Constructor.
Definition:
class.ilNewsData.php:26
ilNewsItem\getNewsOfContext
static getNewsOfContext( $a_context_obj_id, $a_context_obj_type, $a_context_sub_obj_id=0, $a_context_sub_obj_type="")
Get all news of a context.
Definition:
class.ilNewsItem.php:1700
ilNewsData\$_deps
$_deps
Definition:
class.ilNewsData.php:16
ilNewsItem\update
update($a_as_new=false)
Update item in database.
Definition:
class.ilNewsItem.php:699
ilNewsContext\getObjType
getObjType()
Get Obj Type.
Definition:
class.ilNewsContext.php:59
ilNewsItem
Definition:
class.ilNewsItem.php:32
php
ilNewsItem\create
create()
Create.
Definition:
class.ilNewsItem.php:622
ilNewsContext\getSubType
getSubType()
Get Sub Obj Type.
Definition:
class.ilNewsContext.php:79
Services
News
classes
class.ilNewsData.php
Generated on Thu Jan 30 2025 19:02:01 for ILIAS by
1.8.13 (using
Doxyfile
)