ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.PostingManager.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Blog\Posting;
22 
27 
29 {
30  public function __construct(
31  protected InternalDataService $data,
32  protected InternalRepoService $repo,
33  protected InternalDomainService $domain
34  ) {
35  }
36 
37  public function create(Posting $posting): int
38  {
39  return $this->repo->posting()->create($posting);
40  }
41 
42  public function update(Posting $posting): void
43  {
44  $this->repo->posting()->update($posting);
45  }
46 
47  public function delete(Posting $posting): void
48  {
49  $this->repo->posting()->delete($posting->getId());
50  }
51 
52  public function getById(int $id): ?Posting
53  {
54  return $this->repo->posting()->getById($id);
55  }
56 
60  public function getAllByBlog(int $blog_id, int $limit = 1000, int $offset = 0): array
61  {
62  return $this->repo->posting()->getAllByBlog($blog_id, $limit, $offset);
63  }
64 
65  public function exists(int $blog_id, int $posting_id): bool
66  {
67  return $this->repo->posting()->exists($blog_id, $posting_id);
68  }
69 
70  public function lookupBlogId(int $posting_id): ?int
71  {
72  return $this->repo->posting()->lookupBlogId($posting_id);
73  }
74 
75  public function deleteAllByBlog(int $blog_id): void
76  {
77  $this->repo->posting()->deleteAllBlogPostings($blog_id);
78  }
79 
80  public function getLastPost(int $blog_id): int
81  {
82  return $this->repo->posting()->getLastPost($blog_id);
83  }
84 
85  public function searchBlogsByAuthor(int $user_id): array
86  {
87  return $this->repo->posting()->searchBlogsByAuthor($user_id);
88  }
89 }
__construct(protected InternalDataService $data, protected InternalRepoService $repo, protected InternalDomainService $domain)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
exists(int $blog_id, int $posting_id)
getAllByBlog(int $blog_id, int $limit=1000, int $offset=0)