<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */


class HtmlStyle
{
  
  public function getStyle()
  {
    $style = '';
    $objVars = get_object_vars($this);
    foreach ($objVars as $varName => $value) {
      $cssAttribut = str_replace('_', '-', $varName);
      $style .= $cssAttribut . ': ' . $value . '; ';
    }

    return trim($style);
  }

  public function __toString()
  {
    return $this->getStyle();
  }
}