public function setProperties(array $properties, $sync = false)
    {
        $this->properties = [];

        foreach ($properties as $property => $value) {
            $setMethod = 'set' . ucfirst($property);
            if (method_exists($this, $setMethod)) {
                $this->$setMethod($value);
            } else {
                $this->setProperty($property, $value);
            }
        }

        if ($sync) {
            $this->syncOriginal();
        }

        return $this;
    }