for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Silverback API Component Bundle Project
*
* (c) Daniel West <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Silverback\ApiComponentBundle\Entity\Utility;
use DateTime;
use DateTimeImmutable;
/**
* @author Daniel West <[email protected]>
trait TimestampedTrait
{
private ?DateTimeImmutable $createdAt = null;
public ?DateTime $modifiedAt = null;
/** @return static */
public function setCreatedAt(DateTimeImmutable $createdAt)
if (!$this->createdAt) {
$this->createdAt = $createdAt;
}
return $this;
public function getCreatedAt(): ?DateTimeImmutable
return $this->createdAt;
public function setModifiedAt(DateTime $modifiedAt)
$this->modifiedAt = $modifiedAt;
public function getModifiedAt(): ?DateTime
return $this->modifiedAt;