42 lines
642 B
PHP
42 lines
642 B
PHP
<?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;
|
|
}
|
|
}
|