@param Property $property
@throws InvalidArgumentException
@throws NotExistingPropertyException

@api
772026
public function addToObserved(Property $property)
    {
        $this->validatePropertyPaths((string) $this->className, $this->idDefinition, [$property]);
        $this->observedProperties[] = $property;
        $this->observedProperties = array_unique($this->observedProperties);
    }
567792
public function defineProperty(string $property, $constraints = [], $defaultValue = null)
    {
        $this->validProperties[$property] = $constraints;

        if (!is_null($defaultValue)) {
            $this->defaultValues[$property] = $defaultValue;
        }
    }
607644
public function addProperty(RelationshipProperty $property)
    {
        foreach ($this->properties as $prop) {
            if ($prop->getName() === $property->getName()) {
                $this->properties->removeElement($prop);
            }
        }

        return $this->properties->add($property);
    }
1040068
protected function getResponseError($property)
    {
        $exception = $this->getResponseObject();

        if (!$exception instanceof \Exception) {
            throw new InvalidArgumentException('response object', 'is not an exception');
        }

        switch ($property) {
            case 'code':
                return $exception->getCode();

            case 'description':
            case 'message':
                return $exception->getMessage();
        }

        throw new InvalidArgumentException($property, 'is invalid');
    }
1037741
public function updateProperty(\ReflectionProperty $reflectionProperty, Schema $property)
    {
        $annotations = $this->annotationsReader->getPropertyAnnotations($reflectionProperty);

        foreach ($annotations as $annotation) {
            if ($annotation instanceof Assert\NotBlank || $annotation instanceof Assert\NotNull) {
                // The field is required
                if (null === $this->schema) {
                    continue;
                }

                $propertyName = $this->getSchemaPropertyName($property);
                if (null === $propertyName) {
                    continue;
                }

                $existingRequiredFields = $this->schema->getRequired() ?? [];
                $existingRequiredFields[] = $propertyName;

                $this->schema->setRequired(array_values(array_unique($existingRequiredFields)));
            } elseif ($annotation instanceof Assert\Length) {
                $property->setMinLength($annotation->min);
                $property->setMaxLength($annotation->max);
            } elseif ($annotation instanceof Assert\Regex) {
                $this->appendPattern($property, $annotation->getHtmlPattern());
            } elseif ($annotation instanceof Assert\Count) {
                $property->setMinItems($annotation->min);
                $property->setMaxItems($annotation->max);
            } elseif ($annotation instanceof Assert\Choice) {
                $property->setEnum($annotation->callback ? call_user_func(is_array($annotation->callback) ? $annotation->callback : [$reflectionProperty->class, $annotation->callback]) : $annotation->choices);
            } elseif ($annotation instanceof Assert\Expression) {
                $this->appendPattern($property, $annotation->message);
            } elseif ($annotation instanceof Assert\Range) {
                $property->setMinimum($annotation->min);
                $property->setMaximum($annotation->max);
            } elseif ($annotation instanceof Assert\LessThan) {
                $property->setExclusiveMaximum($annotation->value);
            } elseif ($annotation instanceof Assert\LessThanOrEqual) {
                $property->setMaximum($annotation->value);
            }
        }
    }
173243
public function addProperty($property)
    {
        if ($this->hasProperty($property)) {
            throw new LogicException(sprintf('The property "%s" can not be set twice', $property));
        }

        $this->append(sprintf(' %s="%s"', $property, $property));
        array_push($this->properties, $property);

        return $this;
    }
780722
public function setIdentityProperty($property)
    {
        $this->_identity_property = null;

        if (is_string($property)) {
            $property = $this->getProperty($property);
        }

        if ($property) {
            //an identitying property can be used as
            //an identifying property
            $this->addIdentifyingProperty($property);

            //don't allow direct write
            $property->setWriteAccess(AnDomain::ACCESS_PRIVATE);

            $this->_identity_property = $property;
        }

        return $this;
    }
483071
public function getAutocodeProperty($property)
    {
        return isset($this->autocodeProperties[$property])
            ? $this->autocodeProperties[$property]
            : null;
    }
263124
protected function resolvePropertyName($property)
    {
        if ($property instanceof PropertyInterface) {
            $property = $property->ident();
        }

        if (!is_string($property)) {
            throw new InvalidArgumentException(
                'Property must be a string.'
            );
        }

        if ($property === '') {
            throw new InvalidArgumentException(
                'Property can not be empty.'
            );
        }

        return $property;
    }
802085
public function addProperty(Property $property)
    {
        $fieldName = $property->getName();

        // Check for empty field name
        if (empty($fieldName)) {
            throw MappingException::missingFieldName($this->className);
        }

        $property->setDeclaringClass($this);

        switch (true) {
            case $property instanceof VersionFieldMetadata:
                $this->validateAndCompleteFieldMapping($property);
                $this->validateAndCompleteVersionFieldMapping($property);
                break;

            case $property instanceof FieldMetadata:
                $this->validateAndCompleteFieldMapping($property);
                break;

            case $property instanceof OneToOneAssociationMetadata:
                $this->validateAndCompleteAssociationMapping($property);
                $this->validateAndCompleteToOneAssociationMetadata($property);
                $this->validateAndCompleteOneToOneMapping($property);
                break;

            case $property instanceof OneToManyAssociationMetadata:
                $this->validateAndCompleteAssociationMapping($property);
                $this->validateAndCompleteToManyAssociationMetadata($property);
                $this->validateAndCompleteOneToManyMapping($property);
                break;

            case $property instanceof ManyToOneAssociationMetadata:
                $this->validateAndCompleteAssociationMapping($property);
                $this->validateAndCompleteToOneAssociationMetadata($property);
                $this->validateAndCompleteManyToOneMapping($property);
                break;

            case $property instanceof ManyToManyAssociationMetadata:
                $this->validateAndCompleteAssociationMapping($property);
                $this->validateAndCompleteToManyAssociationMetadata($property);
                $this->validateAndCompleteManyToManyMapping($property);
                break;

            default:
                // Transient properties are ignored on purpose here! =)
                break;
        }

        $this->addDeclaredProperty($property);
    }
750718
private function getIntegritySpecification(string $property)
    {
        $constraints = $this->validProperties[$property];

        if (!is_array($constraints)) {
            $constraints = $this->parseIntegritySpecification($this->validProperties[$property]);
        }

        return $constraints;
    }
769952
public function getRelationMappedToProperty(string $property)
    {
        InvalidArgumentException::verify(is_string($property), 'property must be a string');
        $relations = $this->getRelationMappings();

        foreach ($relations as $mapping) {
            $accessor = $mapping->getAccessor();

            if ($accessor instanceof PropertyAccessor) {
                if ($accessor->getPropertyName() === $property) {

                    return $mapping->getRelation();
                }
            }
        }

        return null;
    }
739199
protected function parseSinglePropertyLabel(PropertyInterface $property, $label)
    {
        if (!$property->getLabel()) {
            if (\is_array($label)) {
                $lang        = $label;
                $label       = \reset($lang);
                $description = \next($lang);

                $property->setDescription($description);
            }

            $property->setLabel($label);
        }
    }
318876
public static function get_property_type($property) {

        self::fill_properties_cache();

        if (!array_key_exists($property, self::$propertiescache)) {
            throw new coding_exception('Invalid property requested: ' . $property);
        }

        return self::$propertiescache[$property]['type'];
    }
424838
public function removeProperty($property) {
        foreach (array_keys($this->optionalProperties, $property) as $key) {
            unset($this->optionalProperties[$key]);
        }
        return $this->optionalProperties;
    }
147848
public function removeProperty($property)
    {
        $property = $this->resolvePropertyName($property);
        unset($this->properties[$property]);
        return $this;
    }
1151798
protected function addError($property, $message)
    {
        $this->validationErrors->forProperty($property)->addError(new Error($message, time()));
    }