Пример #1
0
 /**
  * Implements JsonSerializable::jsonSerialize().
  */
 public function jsonSerialize()
 {
     $valid = !isset($this->color) || $this->validateColor($this->color);
     if (!$valid) {
         return NULL;
     }
     return parent::jsonSerialize();
 }
Пример #2
0
 /**
  * Define optional properties.
  */
 protected function optional()
 {
     return array_merge(parent::optional(), array('attachment'));
 }
Пример #3
0
 /**
  * Define optional properties.
  */
 protected function optional()
 {
     return array_merge(parent::optional(), array('userControllable'));
 }
Пример #4
0
 /**
  * Define optional properties.
  */
 protected function optional()
 {
     return array_merge(parent::optional(), array('all', 'top', 'bottom', 'left', 'right'));
 }
Пример #5
0
 /**
  * {@inheritdoc}
  */
 protected function optional()
 {
     return array_merge(parent::optional(), array('identifier', 'layout', 'style', 'anchor', 'animation', 'behavior'));
 }
Пример #6
0
 /**
  * Implements JsonSerializable::jsonSerialize().
  */
 public function jsonSerialize()
 {
     if (!isset($this->componentTextStyles['default'])) {
         $msg = "Document must have at least a \"default\" ComponentTextStyle.";
         $this->triggerError($msg);
         return NULL;
     }
     return parent::jsonSerialize();
 }
Пример #7
0
 /**
  * Implements JsonSerializable::jsonSerialize().
  */
 public function jsonSerialize()
 {
     $valid = (!isset($this->ignoreDocumentMargin) || $this->validateIgnoreDocumentMargin($this->ignoreDocumentMargin)) && (!isset($this->ignoreDocumentGutter) || $this->validateIgnoreDocumentGutter($this->ignoreDocumentGutter)) && (!isset($this->minimumHeight) || $this->validateMinimumHeight($this->minimumHeight));
     if (!$valid) {
         return NULL;
     }
     return parent::jsonSerialize();
 }
Пример #8
0
 /**
  * Implements JsonSerializable::jsonSerialize().
  */
 public function jsonSerialize()
 {
     $valid = (!isset($this->backgroundColor) || $this->validateBackgroundColor($this->backgroundColor)) && (!isset($this->opacity) || $this->validateOpacity($this->opacity));
     if (!$valid) {
         return NULL;
     }
     return parent::jsonSerialize();
 }
Пример #9
0
 /**
  * Define optional properties.
  */
 protected function optional()
 {
     return array_merge(parent::optional(), array('location'));
 }
Пример #10
0
 /**
  * Implements JsonSerializable::jsonSerialize().
  */
 public function jsonSerialize()
 {
     $valid = (!isset($this->textColor) || $this->validateTextColor($this->textColor)) && (!isset($this->textTransform) || $this->validateTextTransform($this->textTransform)) && (!isset($this->backgroundColor) || $this->validateBackgroundColor($this->backgroundColor)) && (!isset($this->verticalAlignment) || $this->validateVerticalAlignment($this->verticalAlignment));
     if (!$valid) {
         return NULL;
     }
     return parent::jsonSerialize();
 }
Пример #11
0
 /**
  * Implements JsonSerializable::jsonSerialize().
  */
 public function jsonSerialize()
 {
     if (isset($this->rangeStart) && !isset($this->rangeLength)) {
         $msg = "If rangeStart is specified, rangeLength is required.";
         $this->triggerError($msg);
         return NULL;
     }
     return parent::jsonSerialize();
 }
Пример #12
0
 /**
  * Expose for testing.
  */
 public static function isHexColor($value)
 {
     return parent::isHexColor($value);
 }