Example #1
0
 /**
  * Constructor.
  *
  * @param string $name Name of the attribute
  * @param int $flags Flags for this attribute
  * @param array $optionArray Array with options
  * @param array $valueArray Array with values. If you don't use this parameter, values are assumed to be the same as the options.
  */
 public function __construct($name, $flags = 0, $optionArray, $valueArray = null)
 {
     // Default options
     if ($this->hasFlag(self::AF_DISPLAY_VERT)) {
         $this->m_rows = true;
     } else {
         $this->m_cols = true;
     }
     $this->m_amount = count($optionArray);
     parent::__construct($name, $flags, $optionArray, $valueArray);
 }
Example #2
0
 /**
  * Constructor.
  *
  * <b>Example:</b>
  *        $this->add(new TimeZoneAttribute("timezone",Attribute::AF_OBLIGATORY));
  *
  * @param string $name Name of the attribute
  * @param int $flags Flags for the attribute
  */
 public function __construct($name, $flags = 0)
 {
     $optionArray = array('timezone_utc_-1200', 'timezone_utc_-1100', 'timezone_utc_-1000', 'timezone_utc_-0900', 'timezone_utc_-0800', 'timezone_utc_-0700', 'timezone_utc_-0600', 'timezone_utc_-0500', 'timezone_utc_-0400', 'timezone_utc_-0300', 'timezone_utc_-0200', 'timezone_utc_-0100', 'timezone_utc_+0000', 'timezone_utc_+0100', 'timezone_utc_+0200', 'timezone_utc_+0300', 'timezone_utc_+0400', 'timezone_utc_+0500', 'timezone_utc_+0600', 'timezone_utc_+0700', 'timezone_utc_+0800', 'timezone_utc_+0900', 'timezone_utc_+1000', 'timezone_utc_+1100', 'timezone_utc_+1200', 'timezone_utc_+1300');
     $valueArray = array('-1200', '-1100', '-1000', '-0900', '-0800', '-0700', '-0600', '-0500', '-0400', '-0300', '-0200', '-0100', '+0000', '+0100', '+0200', '+0300', '+0400', '+0500', '+0600', '+0700', '+0800', '+0900', '+1000', '+1100', '+1200', '+1300');
     parent::__construct($name, $flags, $optionArray, $valueArray);
 }