<?php
namespace App\Model\Entities\Interfaces;

use App\Model\Entities\Security\User;
use App\Model\Exceptions\Db\InvalidStateException;
use App\Model\Interfaces\IEntity;
use DateTime;


interface IBaseRecord extends IEntity
{
    const TRASH = 'trash';
    const DELETED = 'deleted';

    /**
     * @return DateTime
     */
    public function getCreatedAt();

    /**
     * @return User
     */
    public function getCreatedBy() : User;

    /**
     * @return DateTime|null
     */
    public function getEditedAt();

    /**
     * @return User|null
     */
    public function getEditedBy();

    /**
     * @param User $editedBy
     */
    public function setEditedBy(User $editedBy);

    /**
     * @return string
     */
    public function getState() : string;

    /**
     * @param string $state
     * @throws InvalidStateException
     */
    public function setState(string $state);
}