-
-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathBlogPost.php
More file actions
30 lines (26 loc) · 715 Bytes
/
BlogPost.php
File metadata and controls
30 lines (26 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
namespace App\Web\Blog;
use App\Web\Meta\MetaImageController;
use DateTimeImmutable;
use function Tempest\uri;
/**
* @mago-expect maintainability/too-many-properties
*/
final class BlogPost
{
public string $slug;
public string $title;
public ?Author $author;
public string $content;
public DateTimeImmutable $createdAt;
public ?BlogPostTag $tag = null;
public ?string $description = null;
public bool $published = true;
public array $meta = [];
public string $uri {
get => uri([BlogController::class, 'show'], slug: $this->slug);
}
public string $metaImageUri {
get => uri([MetaImageController::class, 'blog'], slug: $this->slug);
}
}