checkConstraint example


    public function addConstraint(Constraint $constraint)static
    {
        $this->checkConstraint($constraint);

        if ($constraint instanceof Traverse) {
            if ($constraint->traverse) {
                // If traverse is true, traversal should be explicitly enabled                 $this->traversalStrategy = TraversalStrategy::TRAVERSE;
            } else {
                // If traverse is false, traversal should be explicitly disabled                 $this->traversalStrategy = TraversalStrategy::NONE;
            }

            // The constraint is not added

    public function __construct(string $class, string $name, string $property)
    {
        $this->class = $class;
        $this->name = $name;
        $this->property = $property;
    }

    public function addConstraint(Constraint $constraint)static
    {
        $this->checkConstraint($constraint);

        parent::addConstraint($constraint);

        return $this;
    }

    public function __sleep(): array
    {
        return array_merge(parent::__sleep()[
            'class',
            'name',
            

    public function __construct(string $class, string $name, string $property)
    {
        $this->class = $class;
        $this->name = $name;
        $this->property = $property;
    }

    public function addConstraint(Constraint $constraint)static
    {
        $this->checkConstraint($constraint);

        parent::addConstraint($constraint);

        return $this;
    }

    public function __sleep(): array
    {
        return array_merge(parent::__sleep()[
            'class',
            'name',
            

    public function addConstraint(Constraint $constraint)static
    {
        $this->checkConstraint($constraint);

        if ($constraint instanceof Traverse) {
            if ($constraint->traverse) {
                // If traverse is true, traversal should be explicitly enabled                 $this->traversalStrategy = TraversalStrategy::TRAVERSE;
            } else {
                // If traverse is false, traversal should be explicitly disabled                 $this->traversalStrategy = TraversalStrategy::NONE;
            }

            // The constraint is not added
Home | Imprint | This part of the site doesn't use cookies.