Add a property

@param PropertyInterface $property Property
556415
public function add(PropertyInterface $property)
    {
        $iri = $property->toIri();

        // Create the property values list if necessary
        if (!$this->offsetExists($iri)) {
            $this->offsetSet($iri, [$property]);
            return;
        }

        $propertyStore =& $this->offsetGet($iri);
        $propertyStore[] = $property;
    }
374550
public static function configure(ObjectInterface $object, $properties)
    {
        // Populate model attributes
        if (!empty($properties)) {
            // To array
            if (!is_array($properties)) {
                $properties = ArrayHelper::toArray($properties, [], false);
            }

            foreach ($properties as $name => $value) {
                if ($object->canSetProperty($name)) {
                    $object->$name = $value;
                }
            }
        }
        return $object;
    }
478843
protected function selectValue(PropertyInterface $property, array $data)
    {
        $errors = [];
        $key = $property->getName();
        $value = array_key_exists($key, $data) ? $data[$key] : null;

        if ($value === null && $property->isRequired()) {
            if (!array_key_exists($key, $data)) {
                $errors[] = Error::MISSING_KEY;
            }
            $errors[] = Error::MISSING_VALUE;
        }

        return empty($errors) ? Ok::unit($value) : Error::unit($errors);
    }
232959
public function addProperty(Property $property): void
    {
        $this->properties[(string) $property->getFqsen()] = $property;
    }
76892
public function setPropertyFilter(PropertyFilterInterface $filter)
    {
        $this->propertyFilter = $filter;

        $this->getReader()->setPropertyFilter($filter);
        $this->getWriter()->setPropertyFilter($filter);

        $dataVersionHash = $this->getDataVersionHash();
        $this->getReader()->setDataVersionHash($dataVersionHash);
        $this->getWriter()->setDataVersionHash($dataVersionHash);
    }
1124730
public function addMissingProperty(MetaEntityInterface $metaEntity, RelationMetaPropertyInterface $property)
    {
        $inversedBy = $property->getInversedBy();
        $mappedBy = $property->getMappedBy();
        if ($newPropertyName = $mappedBy ?: $inversedBy) {
            $inversedType = MetaPropertyFactory::getInversedType($property->getOrmType());
            /** @var RelationMetaPropertyInterface $newProperty */
            $newProperty = $this->metaPropertyFactory->createMetaProperty(
                $metaEntity,
                $inversedType,
                $newPropertyName
            );
            $newProperty->setTargetEntity($property->getMetaEntity());
            if ($inversedBy) {
                $newProperty->setMappedBy($property->getName());
            } else {
                $newProperty->setInversedBy($property->getName());
            }
        }
    }
64701
public function addCookie(CookieInterface $cookie)
    {

        // check if this cookie has already been set
        if ($this->hasCookie($name = $cookie->getName())) {
            // then check if we've already one cookie header available
            if (is_array($cookieValue = $this->getCookie($name))) {
                $cookieValue[] = $cookie;
            } else {
                $cookieValue = array($cookieValue, $cookie);
            }

            // add the cookie array
            $this->cookies[$name] = $cookieValue;

        } else {
            // when add it the first time, simply add it
            $this->cookies[$name] = $cookie;
        }
    }
1212727
protected function initializeProperty(IProperty $property)
    {
        $field = $property->getField();
        $propFullName = $property->getFullName();
        if ($field instanceof IRelationField && !$field instanceof BelongsToRelationField) {
            $property->setInitialValue(null);
        } elseif (array_key_exists($propFullName, $this->initialValues)) {
            $property->setInitialValue($this->initialValues[$propFullName]);
        }
    }
1208627
private function getProvider(PropertyInterface $property)
    {
        $params = $property->getParams();

        $providerAlias = 'pages';
        if (array_key_exists('provider', $params)) {
            $providerAlias = $params['provider']->getValue();
        }

        return $this->dataProviderPool->get($providerAlias);
    }
1354127
public function addProperty($property)
    {
        if (!($property instanceof PropertyInterface)) {
            throw new DcGeneralInvalidArgumentException('Passed value is not an instance of PropertyInterface.');
        }

        $name = $property->getName();

        if ($this->hasProperty($name)) {
            throw new DcGeneralInvalidArgumentException('Property ' . $name . ' is already registered.');
        }

        $this->properties[$name] = $property;

        return $this;
    }
743537
@Override
    public void addProperty(Property property) {
        properties.add(property);
        property.addPropertyChangeListener(this);
        buildModel();
    }
528370
public function addIdentifyingProperty($property)
    {
        if ($property->isSerializable()) {
            $this->_identifying_properties[$property->getName()] = $property;
        }

        //the proeprty as required
        $property->setRequired(true);

        return $this;
    }
980637
public function addProperty(Property $property) {
        $properties = $this->getProperties();
        $properties[] = $property;
        $this->setProperties($properties);
    }
193722
public function addPropertyMetadata($property, $index, $value)
    {
        if (!isset($this->propertyMetadata[$property])) {
            $this->propertyMetadata[$property] = array($index => $value);
        } else {
            $this->propertyMetadata[$property][$index] = $value;
        }

        return $this;
    }
702655
private function addToEntityCollectionAndNotify(string $propName, EntityInterface $entity): void
    {
        if ($this->$propName === null) {
            $this->$propName = new ArrayCollection();
        }
        if ($this->$propName->contains($entity)) {
            return;
        }
        $oldValue = $this->$propName;
        $this->$propName->add($entity);
        $newValue = $this->$propName;
        foreach ($this->notifyChangeTrackingListeners as $listener) {
            $listener->propertyChanged($this, $propName, $oldValue, $newValue);
        }
    }
206275
public static function createFromProperty(PropertyInterface $property)
    {
        $argument = new self();
        $argument
            ->setName($property->getName())
            ->setType($property->getType());

        return $argument;
    }
1327207
public function addAddress(AddressInterface $address): void
    {
        if (!$this->hasAddress($address)) {
            if ($this->isIndividual()) {
                if ($address->getFirstName() === null || $address->getLastName() === null) {
                    $address->setFirstName($this->getFirstName());
                    $address->setLastName($this->getLastName());
                }
            } else {
                if ($address->getLastName() === null) {
                    $address->setLastName($this->getName());
                }
            }

            $this->addresses->add($address);
            $address->setCustomer($this);

            if (!$this->getDefaultAddress()) {
                $this->setDefaultAddress($address);
            }
        }
    }