Your IP : 216.73.216.86


Current Path : /var/www/homesaver/www/bitrix/modules/messageservice/lib/Restriction/
Upload File :
Current File : /var/www/homesaver/www/bitrix/modules/messageservice/lib/Restriction/Parameterizable.php

<?php

namespace Bitrix\MessageService\Restriction;

use Bitrix\MessageService\Internal\Entity\RestrictionTable;

trait Parameterizable
{
	abstract protected function getCurrentAdditionalParam(): string;
	protected function insertCounter(): void
	{
		RestrictionTable::insertCounterWithParam($this->getEntityId(), $this->getCurrentAdditionalParam());
	}

	protected function updateCounter(): bool
	{
		if (in_array($this->getCurrentAdditionalParam(), $this->additionalParams))
		{
			return true;
		}

		return RestrictionTable::updateCounterWithParam($this->getEntityId(), $this->limit, $this->getCurrentAdditionalParam());
	}
}