Files
wallabag/src/Entity/IgnoreOriginInstanceRule.php

70 lines
1.4 KiB
PHP
Raw Normal View History

<?php
2024-02-19 01:30:12 +01:00
namespace Wallabag\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\RulerZ\Validator\Constraints as RulerZAssert;
use Symfony\Component\Validator\Constraints as Assert;
2025-04-05 12:55:51 +02:00
use Wallabag\Repository\IgnoreOriginInstanceRuleRepository;
/**
* Ignore Origin rule.
*/
2025-04-05 12:55:51 +02:00
#[ORM\Table(name: '`ignore_origin_instance_rule`')]
#[ORM\Entity(repositoryClass: IgnoreOriginInstanceRuleRepository::class)]
class IgnoreOriginInstanceRule implements IgnoreOriginRuleInterface, RuleInterface
{
/**
* @var int
*/
2025-04-05 12:55:51 +02:00
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private $id;
/**
* @var string
*
* @Assert\NotBlank()
* @Assert\Length(max=255)
* @RulerZAssert\ValidRule(
* allowed_variables={"host","_all"},
* allowed_operators={"=","~"}
* )
*/
2025-04-05 12:55:51 +02:00
#[ORM\Column(name: 'rule', type: 'string', nullable: false)]
private $rule;
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set rule.
*
* @return IgnoreOriginRuleInterface
*/
public function setRule(string $rule)
{
$this->rule = $rule;
return $this;
}
/**
* Get rule.
*
* @return string
*/
public function getRule()
{
return $this->rule;
}
}