addPropertyMetadata example

/** * Adds a constraint to the given property. * * @return $this */
    public function addPropertyConstraint(string $property, Constraint $constraint)static
    {
        if (!isset($this->properties[$property])) {
            $this->properties[$property] = new PropertyMetadata($this->getClassName()$property);

            $this->addPropertyMetadata($this->properties[$property]);
        }

        $constraint->addImplicitGroupName($this->getDefaultGroup());

        $this->properties[$property]->addConstraint($constraint);

        return $this;
    }

    /** * @param Constraint[] $constraints * * @return $this */
/** * Adds a constraint to the given property. * * @return $this */
    public function addPropertyConstraint(string $property, Constraint $constraint)static
    {
        if (!isset($this->properties[$property])) {
            $this->properties[$property] = new PropertyMetadata($this->getClassName()$property);

            $this->addPropertyMetadata($this->properties[$property]);
        }

        $constraint->addImplicitGroupName($this->getDefaultGroup());

        $this->properties[$property]->addConstraint($constraint);

        return $this;
    }

    /** * @param Constraint[] $constraints * * @return $this */
Home | Imprint | This part of the site doesn't use cookies.