CommandRepositoryInterface.php 1.08 KB
<?php

namespace ServiceCore\Domain\Repository;

use ServiceCore\Domain\Model\EntityInterface;

/**
 * Interface CommandRepositoryInterface
 *
 * @package ServiceCore\Domain\Repository
 */
interface CommandRepositoryInterface
{
    /**
     * @param string $guid
     *
     * @return EntityInterface|null
     */
    public function getByGuid(string $guid): ?EntityInterface;

    /**
     * @param int $id
     *
     * @return EntityInterface|null
     */
    public function getById(int $id): ?EntityInterface;

    /**
     * @param int $parentId
     *
     * @return EntityInterface|null
     */
    public function findParentTreeElement(int $parentId): ?EntityInterface;

    /**
     * @param EntityInterface $entity
     *
     * @return void
     */
    public function insert(EntityInterface $entity): void;

    /**
     * @param EntityInterface $entity
     *
     * @return void
     */
    public function update(EntityInterface $entity): void;

    /**
     * @param EntityInterface $entity
     *
     * @return void
     */
    public function delete(EntityInterface $entity): void;
}