Adds a property

@param string $property
@throws \LogicException When trying to append existing property
@return \Krystal\Form\NodeElement
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;
    }
1077852
public function addChoice(\DOMElement $node)
    {
        if (!$this->multiple && 'radio' !== $this->type) {
            throw new \LogicException(sprintf('Unable to add a choice for "%s" as it is not multiple or is not a radio button.', $this->name));
        }

        $option = $this->buildOptionValue($node);
        $this->options[] = $option;

        if ($node->hasAttribute('checked')) {
            $this->value = $option['value'];
        }
    }
151906
public function set($property, $value = null)
    {
        if (is_string($property) && $value != '') {
            $property = [$property => $value];
        }

        foreach ($property as $name => $value) {
            $this->properties[$name] = $value;
        }

        return $this;
    }
827536
public function append($placeHolder)
	{
		if ( ! $placeHolder instanceof PlaceHolder) {
			throw new \LogicException(__METHOD__ . " accepts PlaceHolder arguments only");
		}
		
		if (isset($this->localization)) {
			
			$placeHolderName = $placeHolder->getName();
			
			// Add to final in cases when it's the page place or locked one
			if ($placeHolder->getLocked() || $placeHolder->getMaster()->equals($this->localization)) {
				
				// Ignore if already set locked place with higher hierarchy level
				if ($this->finalPlaceHolderSet->offsetExists($placeHolderName)) {
					return;
				}
				
				$this->finalPlaceHolderSet->offsetSet($placeHolderName, $placeHolder);
			} else {
				
				// collect not matched template place holders to search for locked blocks
				$this->parentPlaceHolderSet->append($placeHolder);
			}
		}
		
		parent::append($placeHolder);
	}
947456
public function addStyle($property, $style = null)
    {
        if (is_array($property) && is_null($style)) {
            foreach ($property as $k => $v) {
                $this->addStyle($k, $v);
            }

            return $this;
        }
        $this->template->append('style', ';'.$property.':'.$style);

        return $this;
    }
523586
protected function addReverseProperty($property, NodeInterface $node)
    {
        $this->revProperties[$property][$node->getId()] = $node;
    }
385783
public function addAttribute($attribute, $value)
    {
        // Escape special characters
        $value = Filter::filterAttribute($value);

        if ($this->isProperty($attribute)) {
            $this->addPropertyOnDemand($attribute, $value);
        } else {
            if ($this->hasAttribute($attribute)) {
                throw new LogicException(sprintf('The element already has "%s" attribute', $attribute));
            }

            $this->append(sprintf(' %s="%s"', $attribute, $value));
            $this->attributes[$attribute] = $value;
        }

        return $this;
    }
911053
public boolean addProperty(String propertyName, String property) {
        boolean ret = this.properties.containsKey(propertyName);
        this.properties.put(propertyName, property);
        return ret;
    }
906898
public function withProperty(string $property, string $cypher): self
    {
        if ($this->lastOperation === Node::class) {
            $element = $this->elements->last();
        } else {
            $element = $this->elements->dropEnd(1)->last();
        }

        $element = $element->withProperty($property, $cypher);
        $path = new self;
        $path->lastOperation = $this->lastOperation;

        if ($this->lastOperation === Node::class) {
            $path->elements = $this
                ->elements
                ->dropEnd(1)
                ->add($element);
        } else {
            $path->elements = $this
                ->elements
                ->dropEnd(2)
                ->add($element)
                ->add($this->elements->last());
        }

        return $path;
    }
76030
public function setPropertyValue($property, $value) {

        if ($value instanceof ClassMapper) {
            $value = $value->getInstance();
        }

        $this
            ->getProperty($property)
            ->setValue($this->instance, $value);

        return $this;
    }
481322
protected function validateProperty(string $property, bool $needed = false)
    {
        if (!property_exists($this, $property)) {
            throw new InvalidArgumentException("Property {$property} does not exist");
        }

        if ($needed && !isset($this->{$property})) {
            throw new LogicException("Property {$property} could not be calculated");
        }

        return $this;
    }
1102427
public function addProperty(PropertyGenerator $property)
    {
        $name = $property->getName();
        if (isset($this->properties[$name]) === true) {
            throw new InvalidArgumentException('Property name "' . $name . '" already added.');
        }

        $this->properties[$name] = $property;
    }
1246765
public function insert($document)
    {
        $this->ensureAllowedMethodCall(__METHOD__);

        if (null !== $this->listener) {
            $this->listener->beforeInsert($document);
        }

        $id = $this->getWrappedBulk()->insert($document);
        if (null === $id) {
            if ($document instanceof DocumentInterface && !$document->getId()) {
                throw new LogicException(
                    '$document contains an id, but it\'s method getId() does not return it.'
                );
            }

            $id = $this->extractIdFromDocument($document);
        } elseif ($document instanceof DocumentInterface) {
            if ($document->getId()) {
                throw new LogicException(
                    '$document\'s method getId() returns not the same id document will be inserted with.'
                );
            }
            $document->setId($id);
        }

        $this->insertedIds[$this->currentPosition] = $id;
        $this->currentPosition += 1;

        return $id;
    }
859605
public function addProperty(SonarProperty $property)
    {
        $this->propertyElements[] = $property;

        $message = sprintf("Added property: [%s] = [%s].", $property->getName(), $property->getValue());
        $this->log($message, Project::MSG_DEBUG);
    }
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);
    }
525352
public static function make($properties)
    {
        $instance = new self();
        foreach ($properties as $item) {
            $instance->append(
                Property::make($item)
            );
        }

        return $instance;
    }
67924
protected function addFieldType(&$property, Field $field)
    {
        $params = $this->getMethodParamerters($field);
        $property .= sprintf("%s('%s'%s)", $this->getPropertyBase($field->getEloquentDataMethod()), $field->name, $params);

        return $this;
    }