Set properties, trigger warning if unknown property found

@param  array $properties (optional) object properties
@access protected
494208
protected function setProperties(array $properties = [])
    {
        foreach ($properties as $name => $value) {
            // set property
            if (property_exists($this, $name)) {
                $this->$name = $value;

            // unknown property found
            } else {
                trigger_error(
                    sprintf(
                        'unknown property "%s" for "%s"',
                        $name,
                        get_class($this)
                    ),
                    E_USER_WARNING
                );
            }
        }
    }
1045346
public function setProperties($properties)
  {
    if ( is_array($properties) || is_object($properties) ){
      foreach((array)$properties as $k => $v){
        $this->set($k, $v);
      }
      return true;
    }

    return false;
  }
1095732
public function clear($properties = null): void
    {
        $this->properties = [];
        if ($properties === null) {
            $properties = [];
        }
        foreach ($properties as $key => $value) {
            $this->set($key, $value);
        }
    }
330425
protected function dereferenceProperty(...$properties)
    {
        foreach ((array)$properties as $property) {
            if (!property_exists($this, $property)) {
                continue; // @codeCoverageIgnore
            }
            
            $value = $this->$property;
            unset($this->$property);
            $this->$property = $value;
        }
    }
346856
protected function setLabelsProperty(array $properties)
    {
        $labels = $this->getLabelsFromProperties($properties);

        foreach ($labels as $label) {
            $this->addLabel($label->text, $label->isPlain, $label->lang);
        }

        return $this;
    }
637324
public function addProperties($properties)
    {
        foreach ($properties as $key => $value) {
            $this->setProperty($key, $value);
        }

        return $this;
    }
1093742
public function setRange(array $properties)
    {
        if (self::isValidSelectRangeType($properties)) {
            $this->range = explode(':', substr($properties['html-type'], 12));
        }

        if (Helpers::isKeyExists($properties, 'range') && is_array($properties['range'])) {
            $this->range = $properties['range'];
        }

        return $this;
    }
621271
public function setRawProperties( $properties )
    {
        if ( ! empty( $properties ) )
        {
            foreach ( $properties as $name => $value )
            {
                switch ( true )
                {
                    case is_array( $value ) &&
                            array_key_exists( 'value', $value ):
                        $value = (object) $value;

                    case is_object( $value ):
                        if ( ! isset( $value->value ) )
                        {
                            $value->value = null;
                        }

                        if ( ! isset( $value->priority ) )
                        {
                            $value->priority = null;
                        }

                        if ( ! isset( $value->name ) )
                        {
                            $value->name = $name;
                        }

                        $this->setRawProperty(
                            $value->name,
                            $value->value,
                            $value->priority
                        );
                        break;

                    case is_array( $value ):
                        if ( count( $value ) > 2 )
                        {
                            list( $rawName, $value, $priority ) = $value;

                            if ( empty( $rawName ) )
                            {
                                $rawName = $name;
                            }
                        }
                        else if ( count( $value ) > 1 )
                        {
                            $rawName = $name;
                            list( $value, $priority ) = $value;
                        }
                        else
                        {
                            $rawName    = $name;
                            $priority   = null;
                            $value      = empty( $value ) ? null : current( $value );
                        }

                        $this->setRawProperty( $rawName, $value, $priority );
                        break;

                    default:
                        $this->setRawProperty( $name, $value );
                        break;
                }
            }
        }

        return $this;
    }
850937
public function setProperties(array $properties)
	{
		foreach($properties as $key=>$value)
			$this->parseProperty($key, $value);

		return $this;
	}
91188
public function setProperties(array $properties)
    {
        foreach ($properties as $propertyIdent => $propertyMetadata) {
            if (isset($this->properties[$propertyIdent])) {
                $this->properties[$propertyIdent] = array_replace_recursive(
                    $this->properties[$propertyIdent],
                    $propertyMetadata
                );
            } else {
                $this->properties[$propertyIdent] = $propertyMetadata;
            }
        }

        return $this;
    }
1275959
public function setParamProperties($properties = array())
    {
        $map = array('type'    => 'type',
                     'io'       => 'io',
                 'comment'  => 'comment',
                 'var'      => 'varName',
                 'data'     => 'data',
                 'varying'  => 'varying',
                 'dim'      => 'dimension',
                 'by'       => 'by',
                 'array'    => 'isArray',
                 'setlen'   => 'labelSetLen',
                 'len'      => 'labelLen',
                 'dou'      => 'labelDoUntil',
                 'enddo'    => 'labelEndDo',
                 'ccsidBefore' => 'ccsidBefore',
                 'ccsidAfter'  => 'ccsidAfter',
                 'useHex'      => 'useHex',
        );

        // go through all properties and set the ones that are valid,
        // using the mapping above to find the true property name.
        foreach ($properties as $key=>$value) {
            $propName = isset($map[$key]) ? $map[$key] : '';
            
            if ($propName) {
                // a valid property name was found so set it
                $this->$propName = $value;
            }
        }
    }
297370
public function dropIndex($properties)
    {
        $properties = (array) $properties;

        foreach ($properties as $property)
        {
            $this->indexCommand('dropIndex', $property);
        }
    }
1062236
public function setIdentification($properties)
    {
        $this->reset($properties);

        if (!empty($this->model)) {
            $this->generic = false;
        }
        
        $this->identified |= Constants\Id::MATCH_UA;
    }
54004
public function modify(array $properties)
  {
    $properties["clid"] = $this->getId();

    $this->execute("clientedit", $properties);
    $this->resetNodeInfo();
  }
939705
public static function fromProperties(array $properties)
    {
        $copy = new self();
        foreach (self::getPropertyNames() as $name) {
            if (isset($properties[$name])) {
                $copy->{'set'.ucfirst($name)}($properties[$name]);
            }
        }

        return $copy;
    }
76926
protected function setFields($fields) 
    {
    	foreach ($fields as $name => $value) {
            $property = '_' . $name;
            if (property_exists($this, $property)) $this->$property = $value;
        }
    }
66542
public function unsetAll($properties) {
		foreach($properties as $prop) {
			if (isset($this->properties[$prop])) {
				unset($this->properties[$prop]);
			}
		}
		return $this;
	}