19declare(strict_types=1);
39 return $this->repo->posting()->create($posting);
44 $this->repo->posting()->update($posting);
47 public function delete(
int $posting_id):
void
49 $this->repo->posting()->delete($posting_id);
54 $posting = $this->repo->posting()->getById(
$id);
61 public function getAllByBlog(
int $blog_id,
int $limit = 1000,
int $offset = 0): array
65 $this->repo->posting()->getAllByBlog($blog_id, $limit, $offset)
72 public function getAllPostingIds(
int $blog_id,
int $limit = 1000,
int $offset = 0): array
76 foreach ($this->repo->posting()->getAllByBlog($blog_id, $limit, $offset) as $posting) {
77 $id = $posting->getId();
78 if (isset($pages[
$id])) {
92 public function getAllPostings(
int $a_blog_id,
int $a_limit = 1000,
int $a_offset = 0): array
101 $id = $posting->getId();
102 if (isset($pages[
$id])) {
110 public function exists(
int $blog_id,
int $posting_id): bool
112 return $this->repo->posting()->exists($blog_id, $posting_id);
117 return $this->repo->posting()->lookupBlogId($posting_id);
122 $lom = $this->domain->lom();
124 $lom->deleteAll($blog_id, $posting_id,
"blp");
126 $this->repo->posting()->deleteAllBlogPostings($blog_id);
131 return $this->repo->posting()->getLastPost($blog_id);
136 return $this->repo->posting()->searchBlogsByAuthor(
$user_id);
141 $lom_services = $this->domain->lom();
144 $keywords = $lom_services->read($blog_id, $posting_id,
"blp")
145 ->allData($lom_services->paths()->keywords());
146 foreach ($keywords as $keyword) {
147 if ($keyword->value() !==
"") {
148 $result[] = $keyword->value();
158 $this->domain->pageManager()->lookupActive($posting->
getId(),
"blp")
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Domain class for handling news items of blog postings.
lookupBlogId(int $posting_id)
getLastPost(int $blog_id)
getAllPostings(int $a_blog_id, int $a_limit=1000, int $a_offset=0)
Return all postings of a blog as data objects (Posting[]), filtered to those that have an associated ...
__construct(protected InternalDataService $data, protected InternalRepoService $repo, protected InternalDomainService $domain)
deleteAllByBlog(int $blog_id)
getAllPostingIds(int $blog_id, int $limit=1000, int $offset=0)
getAllByBlog(int $blog_id, int $limit=1000, int $offset=0)
getKeywords(int $blog_id, int $posting_id)
searchBlogsByAuthor(int $user_id)
exists(int $blog_id, int $posting_id)
withPageActivation(Posting $posting)
static getAllPages(string $a_parent_type, int $a_parent_id, string $a_lang="-")
Get all pages for parent object.