Установить настройки для добавления значения enum инфоблока по умолчанию
@param string $xml_id
@param string $value
@param int $propertyId
@return $this
968040
public function constructDefault($xml_id, $value, $propertyId = null)
    {
         $this->setXmlId($xml_id)->setValue($value);

         if ($propertyId) {
             $this->setPropertyId($propertyId);
         }

         return $this;
    }
79466
public function setCustomProperty($propertyName, $propertyValue = '', $propertyType = null)
    {
        if (($propertyType === null) || (!in_array($propertyType, array(self::PROPERTY_TYPE_INTEGER,
                                                                        self::PROPERTY_TYPE_FLOAT,
                                                                        self::PROPERTY_TYPE_STRING,
                                                                        self::PROPERTY_TYPE_DATE,
                                                                        self::PROPERTY_TYPE_BOOLEAN)))) {
            if ($propertyValue === null) {
                $propertyType = self::PROPERTY_TYPE_STRING;
            } elseif (is_float($propertyValue)) {
                $propertyType = self::PROPERTY_TYPE_FLOAT;
            } elseif (is_int($propertyValue)) {
                $propertyType = self::PROPERTY_TYPE_INTEGER;
            } elseif (is_bool($propertyValue)) {
                $propertyType = self::PROPERTY_TYPE_BOOLEAN;
            } else {
                $propertyType = self::PROPERTY_TYPE_STRING;
            }
        }

        $this->customProperties[$propertyName] = array(
            'value' => $propertyValue,
            'type' => $propertyType
        );
        return $this;
    }
207173
public function selectOptionByValueOfElementById($value, $elementId, $timeout = 0)
    {
        $element = $this->clickDisplayedElementByID($elementId, $timeout);

        \PHPUnit_Extensions_Selenium2TestCase_Element_Select::fromElement($element)->selectOptionByValue($value);

        return $element;
    }
1246262
private function loadPropertyMetadata(\DOMXPath $xpath, \DOMNode $propertyNode)
    {
        $propertyMetadata = null;
        switch ($propertyNode->nodeName) {
            case 'concatenation-property':
                $propertyMetadata = $this->loadConcatenationPropertyMetadata($xpath, $propertyNode);
                break;
            case 'identity-property':
                $propertyMetadata = $this->loadIdentityPropertyMetadata($xpath, $propertyNode);
                break;
            case 'group-concat-property':
                $propertyMetadata = $this->loadGroupConcatPropertyMetadata($xpath, $propertyNode);
                break;
            case 'case-property':
                $propertyMetadata = $this->loadCasePropertyMetadata($xpath, $propertyNode);
                break;
            case 'count-property':
                $propertyMetadata = $this->loadCountPropertyMetadata($xpath, $propertyNode);
                break;
            case 'property':
                $propertyMetadata = $this->loadSinglePropertyMetadata($xpath, $propertyNode);
                break;
            default:
                throw new \InvalidArgumentException(sprintf(
                    'The tag "%s" cannot be handled by this loader',
                    $propertyNode->nodeName
                ));
        }

        if (null !== $translation = XmlUtil::getValueFromXPath('@translation', $xpath, $propertyNode)) {
            $propertyMetadata->setTranslation($translation);
        }

        if (null !== $type = XmlUtil::getValueFromXPath('@type', $xpath, $propertyNode)) {
            $propertyMetadata->setType($type);
        }

        $propertyMetadata->setVisibility(
            XmlUtil::getValueFromXPath(
                '@visibility',
                $xpath,
                $propertyNode,
                FieldDescriptorInterface::VISIBILITY_NO
            )
        );
        $propertyMetadata->setSearchability(
            XmlUtil::getValueFromXPath(
                '@searchability',
                $xpath,
                $propertyNode,
                FieldDescriptorInterface::SEARCHABILITY_NEVER
            )
        );
        $propertyMetadata->setSortable(
            XmlUtil::getBooleanValueFromXPath('@sortable', $xpath, $propertyNode, true)
        );
        $propertyMetadata->setFilterType(XmlUtil::getValueFromXPath('@filter-type', $xpath, $propertyNode));
        $propertyMetadata->setFilterTypeParameters($this->getFilterTypeParameters($xpath, $propertyNode));

        return $propertyMetadata;
    }
981631
public function setAttribute($name, $value) {
		if ($this->_attributes === null) {
			$this->initAttributes();
		}
		
		$this->_attributes[$name] = $value;
		
		$this->_xml->addAttribute($name, $value);
		
		return $this;
	}
1310242
public String setPropertyTypeFromEntityIdValue(
			PropertyIdValue propertyIdValue, EntityIdValue value) {
		switch (value.getId().charAt(0)) {
		case 'Q':
			return DatatypeIdValue.DT_ITEM;
		case 'P':
			return DatatypeIdValue.DT_PROPERTY;
		default:
			logger.warn("Could not determine Type of "
					+ propertyIdValue.getId()
					+ ". It is not a valid EntityDocument Id");
			return null;
		}
	}
180175
private function createOptionElement($xml, $key, $value)
    {
        $option = $xml->createElement('option');
        $this->addAttributes($option, ['value' => $key]);

        $text = $xml->createTextNode($value);
        $option->appendChild($text);

        return $option;
    }
764245
public function table(string $class_name, string $id_value = ''): self
    {
        if (preg_match(",\s,", $id_value)) {
            throw new DOMException("the id attribute's value must not contain whitespace (spaces, tabs etc.)");
        }
        $clone = clone $this;
        $clone->class_name = $class_name;
        $clone->id_value = $id_value;

        return $clone;
    }
335141
public function savePropertyId($propertyId, $id = false)
    {
        $em = $this->getEntityManager();
        $config = $id ? $this->find($id) : $this->findFirst();
        $config->setPropertyId($propertyId);
        $em->persist($config);
        $em->flush();
    }
764395
public function setIdentifierValue($xmlEntity, array $id)
    {
        foreach ($id as $idField => $idValue) {
            $this->reflFields[$idField]->setValue($xmlEntity, $idValue);
        }
    }
317605
private function encodeValue(XMLWriter $xml, $value) {

        if ( $value === null ) $xml->writeRaw($this->use_ex_nil === true ? '<ex:nil />' : '<nil />');

        else if ( is_array($value) ) {

            if ( !self::catchStruct($value) ) $this->encodeArray($xml, $value);

            else $this->encodeStruct($xml, $value);

        } else if ( @array_key_exists($value, $this->special_types) ) {

            switch ( $this->special_types[$value] ) {

                case 'base64':
                    
                    $xml->writeElement("base64", $value);

                    break;
                
                case 'datetime':
                    
                    $xml->writeElement("dateTime.iso8601", self::timestampToIso8601Time($value));

                    break;
                
                case 'cdata':
                    
                    $xml->writeCData($value);

                    break;
                
            }

        } else if ( is_bool($value) ) {

            $xml->writeElement("boolean", $value ? 1 : 0);

        } else if ( is_double($value) ) {

            $xml->writeElement("double", $value);

        } else if ( is_integer($value) ) {
            
            $xml->writeElement("int", $value);

        } else if ( is_object($value) ) {

            $this->encodeObject($xml, $value);

        } else if ( is_string($value) ) {

            $value = htmlentities($value, ENT_QUOTES, $this->encoding, false);

            $string = preg_replace_callback('/&([a-zA-Z][a-zA-Z0-9]+);/S', 'self::numericEntities', $value);

            $xml->writeRaw("<string>".$string."</string>");

        } else throw new XmlrpcException("Unknown type for encoding");

    }
1259110
@Override
    public final void put(Context cx, Object id, Object value) {
        if (cx == null) cx = Context.getCurrentContext();
        XMLName xmlName = lib.toXMLNameOrIndex(cx, id);
        if (xmlName == null) {
            long index = ScriptRuntime.lastUint32Result(cx);
            // XXX Fix this cast
            put((int)index, this, value);
            return;
        }
        putXMLProperty(xmlName, value);
    }
438129
public function SetField($RowID, $Property, $Value = FALSE) {
      if (!is_array($Property))
         $Property = array($Property => $Value);
      
      $this->DefineSchema();      
      $Set = array_intersect_key($Property, $this->Schema->Fields());
      self::SerializeRow($Set);
      $this->SQL->Put($this->Name, $Set, array($this->PrimaryKey => $RowID));
   }
989406
private function setNodePropertyForSession(SessionInterface $session, $nodePath, $propertyName, $value)
    {
        $session->getNode($nodePath)->setProperty($propertyName, $value);
    }
687156
protected function addXmlObject(\XMLWriter $xmlWriter, Parameter $param, &$value)
    {
        $noAttributes = array();
        // add values which have attributes
        foreach ($value as $name => $v) {
            if ($property = $param->getProperty($name)) {
                if ($property->getData('xmlAttribute')) {
                    $this->addXml($xmlWriter, $property, $v);
                } else {
                    $noAttributes[] = array('value' => $v, 'property' => $property);
                }
            }
        }
        // now add values with no attributes
        foreach ($noAttributes as $element) {
            $this->addXml($xmlWriter, $element['property'], $element['value']);
        }
    }
1049378
protected function processNodePropertyObject($name, $value, array &$properties)
    {
        if (!empty($value->type) || !empty($value->lang)) {
            $properties[$name]->values[] = $value;

            // @type = @id
        } elseif (!empty($value->id)) {
            $properties[$name]->values[] = $value->id;
        }
    }
749088
public function setProperty($propertyName, $value)
    {
        if ($value !== $this->getProperty($propertyName)) {
            $this->setMeta(static::IS_CHANGED, true);
            $this->setPropertyRaw($propertyName, $value);
        }
    }