Add new child item.

@param array $properties

@return static
973968
protected function add(array $properties = [])
    {
        $properties['attributes']['id'] = $properties['attributes']['id'] ?? md5(json_encode($properties));
        $this->childs->push($item = new static($properties));

        return $item;
    }
906111
public function addSets(array $values = array())
    {
        foreach ($values as $column => $value) {
            $this->addSet($column, $value);
        }

        return $this;
    }
597608
public function withProperties(array $properties): self
    {
        $query = $this;

        foreach ($properties as $property => $cypher) {
            $query = $query->withProperty($property, $cypher);
        }

        return $query;
    }
932440
public function addFields(array $fields)
    {
        collect($fields)->each(function ($field, $key) {
            if (! $field instanceof AttachmentField) {
                $field = [$key => $field];
            }

            $this->addField($field);
        });

        return $this;
    }
1029670
protected function setupOne(array $properties) {
        $pkName = $this->pkName;
        /** @var Column $column */
        foreach ($this->tableSchema->columns as $column) {
            if (!array_key_exists($column->name, $properties)) {
                continue;
            }

            if (null !== $properties[$column->name]) {
                if ($column->isInt()) {
                    $this->_properties[$column->name] =
                        (int) $properties[$column->name];
                } else if ($column->isFloat()) {
                    $this->_properties[$column->name] =
                        (float) $properties[$column->name];
                } else {
                    $this->_properties[$column->name] =
                        $properties[$column->name];
                }
            } else {
                $this->_properties[$column->name] = null;
            }
        }
        $this->_modified = array();
        $this->_oldPK = $this->_properties[$pkName] ?? null;
        return $this;
    }
765954
public function setProperties(array $properties) {
		foreach ($this->properties as $prop) {
			$prop->setParent(null);
		}

		$this->properties->clear();

		foreach ($properties as $prop) {
			$this->setProperty($prop);
		}

		return $this;
	}
470318
public function addMany(array $attributes)
    {
        if (count($attributes) > 0) {
            foreach($attributes as $name => $value) {
                $this->add($name, $value);
            }
        }

        return $this;
    }
1314956
public function add( array $values )
	{
		$this->baskets[$this->type] = $this->get()->fromArray( $values );
		return $this;
	}
1241490
public function setChildren(array $children)
    {

        $this->removeChildren();
        foreach ($children as $child)
            $this->appendChild($child);

        return $this;
    }
903228
public function sets(array $properties)
  {
    foreach($properties as $k => $v){
      $this->set($k, $v);
    }
    return $this;
  }
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;
    }
864767
public function setPredefindProperties(array $properties)
    {
        foreach ($this->predefinedKeyMapping as $key => $property) {
            if (Helpers::isKeyExists($properties, $key)) {
                if (is_array($property)) {
                    foreach ($property as $name) {
                        $this->{$name} = $properties[$key];
                    }
                } else {
                    $this->{$property} = $properties[$key];
                }
            }
        }

        return $this;
    }
962158
public function append($items)
	{
		foreach( (array) $items as $key => $item ) 
		{
			array_push($this->attributes, $item);
		}

		return $this;
	}
642015
public function addHiddenProperties(array $properties)
    {
        foreach ($properties as $propertyIdent => $property) {
            $this->addHiddenProperty($propertyIdent, $property);
        }

        return $this;
    }
1222923
public static function create(array $properties): SkeletonEmbeddableInterface
    {
        if (array_key_exists(SkeletonEmbeddableInterface::EMBEDDED_PROP_PROPERTY_ONE, $properties)) {
            return new self(
                $properties[SkeletonEmbeddableInterface::EMBEDDED_PROP_PROPERTY_ONE],
                $properties[SkeletonEmbeddableInterface::EMBEDDED_PROP_PROPERTY_TWO]
            );
        }

        return new self(...array_values($properties));
    }
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;
    }
628319
public function addProperties($properties)
    {
        if (empty($properties) || !count((array)$properties)) {
            throw new \Exception('Empty properties given');
        }

        if (!is_array($properties) && !is_object($properties)) {
            throw new \Exception('Expected array or object');
        }

        foreach ($properties as $key => $property) {
            $this->addProperty($key, $property);
        }

        return $this;
    }