public function extract(array $properties, $onlyDirty = false)
    {
        $result = [];
        foreach ($properties as $property) {
            if (!$onlyDirty || $this->isDirty($property)) {
                $result[$property] = $this->get($property);
            }
        }

        return $result;
    }