Example #1
0
 /**
  * @param string $value
  * @return $this
  */
 public function __construct($value = null)
 {
     $this->init()->setValue($value)->setAttributes(Attributes::create());
     return $this;
 }
Example #2
0
 /**
  * @param mixed $content
  * @return $this
  */
 public function __construct($content = null)
 {
     $this->init();
     $contents = Contents::create()->setElement($this);
     if ($content) {
         $contents->setContents(is_array($content) ? $content : array($content));
     }
     $this->setAttributes(Attributes::create());
     $this->setContent($contents);
     return $this;
 }