Update core 8.3.0

This commit is contained in:
Rob Davies 2017-04-13 15:53:35 +01:00
parent da7a7918f8
commit cd7a898e66
6144 changed files with 132297 additions and 87747 deletions

View file

@ -319,6 +319,30 @@ class ClassMetadata extends ElementMetadata implements ClassMetadataInterface
return $this;
}
/**
* Adds a constraint to the getter of the given property.
*
* @param string $property The name of the property
* @param string $method The name of the getter method
* @param Constraint $constraint The constraint
*
* @return $this
*/
public function addGetterMethodConstraint($property, $method, Constraint $constraint)
{
if (!isset($this->getters[$property])) {
$this->getters[$property] = new GetterMetadata($this->getClassName(), $property, $method);
$this->addPropertyMetadata($this->getters[$property]);
}
$constraint->addImplicitGroupName($this->getDefaultGroup());
$this->getters[$property]->addConstraint($constraint);
return $this;
}
/**
* @param string $property
* @param Constraint[] $constraints
@ -334,6 +358,22 @@ class ClassMetadata extends ElementMetadata implements ClassMetadataInterface
return $this;
}
/**
* @param string $property
* @param string $method
* @param Constraint[] $constraints
*
* @return $this
*/
public function addGetterMethodConstraints($property, $method, array $constraints)
{
foreach ($constraints as $constraint) {
$this->addGetterMethodConstraint($property, $method, $constraint);
}
return $this;
}
/**
* Merges the constraints of the given metadata into this object.
*
@ -346,10 +386,6 @@ class ClassMetadata extends ElementMetadata implements ClassMetadataInterface
}
foreach ($source->getConstrainedProperties() as $property) {
if ($this->hasPropertyMetadata($property)) {
continue;
}
foreach ($source->getPropertyMetadata($property) as $member) {
$member = clone $member;