public function getOneEntityBy(array $criteria = [], array $orders = [], $offset = null): ?AbstractEntity
    {
        $entity = $this->getRepository()->findOneBy($criteria, $orders, $offset);

        if ($entity instanceof AbstractEntity) {
            $this->prepareEntityForGet($entity);
        }

        return $entity;
    }