@param null $uuid

@throws ListElementNotAllowedUuidException
197057
public function setUUid($uuid = null)
    {
        $notAllowedNames = [
            ListRepositoryInterface::CHUNK,
            ListRepositoryInterface::HEADERS,
            ListRepositoryInterface::INDEX,
            ListRepositoryInterface::SEPARATOR,
            ListRepositoryInterface::STATISTICS,
        ];

        foreach ($notAllowedNames as $notAllowedName) {
            if (strpos($uuid, $notAllowedName) !== false) {
                throw new ListElementNotAllowedUuidException('You can\'t assign "'.$uuid.'" as element uuid.');
            }
        }

        $this->uuid = str_replace(' ', '-', $uuid) ?: Uuid::uuid4()->toString();
    }
257408
public function updateElement($listUuid, $elementUuid, $data)
    {
        $listElement = $this->findElement(
            (string) $listUuid,
            (string) $elementUuid
        );

        $updatedElementBody = $this->updateListElementBody($listElement, $data);

        if (!ListElementConsistencyChecker::isConsistent($updatedElementBody, $this->findListByUuid($listUuid))) {
            throw new ListElementNotConsistentException('Element '.(string) $elementUuid.' is not consistent with list data.');
        }

        if (is_array($updatedElementBody) || is_object($updatedElementBody)) {
            $updatedElementBody = serialize($updatedElementBody);
        }

        $sql = 'UPDATE `'.self::LIST_ELEMENT_TABLE_NAME.'` 
                    SET `body` = :body
                    WHERE `uuid` = :uuid';

        $stmt = $this->pdo->prepare($sql);
        $stmt->bindParam(':uuid', $elementUuid);
        $stmt->bindParam(':body', $updatedElementBody);
        $stmt->execute();
    }
75762
public function getIndex($listUuid = null)
    {
        $lt = self::LIST_ELEMENT_TABLE_NAME;
        $lc = self::LIST_COLLECTION_TABLE_NAME;

        $sql = 'SELECT
                `'.$lc.'`.`uuid`,
                `'.$lc.'`.`headers`,
                `'.$lc.'`.`created_at`
                FROM `'.$lt.'` 
                INNER JOIN `'.$lc.'` 
                ON `'.$lt.'`.`list` = `'.$lc.'`.`uuid`';

        if ($listUuid) {
            $sql .= 'WHERE `'.$lc.'`.`uuid` = :list';
        }

        $stmt = $this->pdo->prepare($sql);
        if ($listUuid) {
            $stmt->bindParam(':list', $listUuid);
        }
        $stmt->execute();

        $list = $stmt->fetchAll(\PDO::FETCH_ASSOC);

        $index = [];

        foreach ($list as $item) {
            $index[$item['uuid']] = [
                'uuid' => $item['uuid'],
                'created_on' => \DateTime::createFromFormat('Y-m-d H:i:s.u', $item['created_at']),
                'size' => $this->getCounter($item['uuid']),
                'chunks' => 0,
                'chunk-size' => 0,
                'headers' => $this->getHeaders($item['uuid']),
                'ttl' => 0,
            ];
        }

        return $index;
    }
931986
@Override
	public void removeByUuid(String uuid) {
		for (CommerceOrder commerceOrder : findByUuid(uuid, QueryUtil.ALL_POS,
				QueryUtil.ALL_POS, null)) {
			remove(commerceOrder);
		}
	}
1358647
@SuppressWarnings("unchecked")
    public <T> T getObjectByUuid(Class<T> clazz, UUID uuid) {
        final Query query = pm.newQuery(clazz, "uuid == :uuid");
        final List<T> result = (List<T>) query.execute(uuid);
        return Collections.isEmpty(result) ? null : result.get(0);
    }
143673
public function deleteElement($listUuid, $elementUuid)
    {
        $sql = 'DELETE FROM `'.self::LIST_ELEMENT_TABLE_NAME.'` WHERE `uuid` = :uuid AND `list` = :list';
        $stmt = $this->pdo->prepare($sql);
        $stmt->bindParam(':uuid', $elementUuid);
        $stmt->bindParam(':list', $listUuid);
        $stmt->execute();
    }
608228
public function getFileFromUuid($uuid)
    {
        if ($path = $this->getPathFromUuid($uuid)) {
            if (is_dir($this->container->get('huh.utils.container')->getProjectDir().\DIRECTORY_SEPARATOR.$path)) {
                return null;
            }

            return new File($path);
        }
    }
266824
private function resetVisitorUuid($data = null)
    {
        $this->visitorInfo['uuid'] = null;

        $data = $data ?: $this->visitorInfo;

        unset($data['uuid']);

        $this->putSessionData($data);
        $this->checkVisitorUuid();

        return $data;
    }
506886
public static void checkId(CmsUUID id, boolean canBeNull) {

        if (canBeNull && (id == null)) {
            return;
        }
        if ((!canBeNull && (id == null)) || id.isNullUUID()) {
            throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_INVALID_UUID_1, id));
        }
    }
537299
@Override
	public void removeByUuid(String uuid) {
		for (CommerceNotificationTemplate commerceNotificationTemplate : findByUuid(
				uuid, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceNotificationTemplate);
		}
	}
1237083
@Override
	public void removeByUuid(String uuid) {
		for (CommerceCountry commerceCountry : findByUuid(uuid,
				QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceCountry);
		}
	}
10880
@Override
	public void removeByUuid(String uuid) {
		for (CPOption cpOption : findByUuid(uuid, QueryUtil.ALL_POS,
				QueryUtil.ALL_POS, null)) {
			remove(cpOption);
		}
	}
886745
@Override
	public void removeByUuid(String uuid) {
		for (CommerceWishList commerceWishList : findByUuid(uuid,
				QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceWishList);
		}
	}
415301
@Override
	public void removeByUuid(String uuid) {
		for (CommercePriceListUserSegmentEntryRel commercePriceListUserSegmentEntryRel : findByUuid(
				uuid, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commercePriceListUserSegmentEntryRel);
		}
	}
1291322
@Override
	public void removeByUuid(String uuid) {
		for (CPMeasurementUnit cpMeasurementUnit : findByUuid(uuid,
				QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(cpMeasurementUnit);
		}
	}
819098
public function pushElement($listUuid, $elementUuid, array $data = [])
    {
        $newElement = new ListElement(
            new ListElementUuid($elementUuid),
            $data
        );

        return $this->repository->pushElement($listUuid, $newElement);
    }
206564
public function setUuid($uuid)
    {
        if (!is_null($uuid)) {
            $uuid = (string) $uuid;
        }

        $this->uuid = $uuid;
        return $this;
    }