Source of file EntityBlameable.php

Size: 1,279 Bytes - Last Modified: 2023-11-16T22:56:02+01:00

/home/websites/teicee/packagist/site/phpdoc/conf/../vendor/teicee/dorm-bundle/src/Traits/EntityBlameable.php

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
<?php
namespace TIC\DormBundle\Traits;

use Doctrine\ORM\Mapping as ORM;

/**
 * Gestion des champs createdBy et updatedBy d'une entité Doctrine.
 * 
 * Alternative sans nécessiter ni extension Doctrine, ni bundle tiers,
 * tels que Gedmo et StofDoctrineExtensionsBundle.
 * @see Gedmo\Timestampable\Traits\BlameableEntity;
 * 
 * ATTENTION: aucune prise en charge automatique !
 */
trait EntityBlameable
{
	/**
	 * @ORM\Column(type="string")
	 */
	private $createdBy;

	/**
	 * @ORM\Column(type="string", nullable=true)
	 */
	private $updatedBy;

	// --------------------------------------------------------------------- Accessors (getters)

	/**
	 * Get the creation author.
	 */
	public function getCreatedBy(): ?string
	{
		return $this->createdBy;
	}

	/**
	 * Get the modification author.
	 */
	public function getUpdatedBy(): ?string
	{
		return $this->updatedBy;
	}

	// --------------------------------------------------------------------- Mutators (setters)

	/**
	 * Set the creation author.
	 */
	public function setCreatedBy(?string $createdBy): self
	{
		$this->createdBy = $createdBy;
		return $this;
	}

	/**
	 * Set the modification author.
	 */
	public function setUpdatedBy(?string $updatedBy): self
	{
		$this->updatedBy = $updatedBy;
		return $this;
	}

}