41
app/Models/Calendar/Day.php
Normal file
41
app/Models/Calendar/Day.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Calendar;
|
||||
|
||||
use App\Post;
|
||||
use DateTime;
|
||||
|
||||
class Day
|
||||
{
|
||||
/** @var DateTime */
|
||||
protected $date;
|
||||
/** @var Post|null */
|
||||
protected $post;
|
||||
|
||||
/**
|
||||
* Day constructor.
|
||||
* @param DateTime $date
|
||||
* @param Post $post
|
||||
*/
|
||||
public function __construct(DateTime $date, Post $post = null)
|
||||
{
|
||||
$this->date = $date;
|
||||
$this->post = $post;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DateTime
|
||||
*/
|
||||
public function getDate(): DateTime
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Post
|
||||
*/
|
||||
public function getPost(): ?Post
|
||||
{
|
||||
return $this->post;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user