コード例 #1
0
 /**
  * AbstractCompoundType Constructor.
  *
  * @param   string                 $title    The title
  * @param   string                 $id       The identifier
  * @param   \stdClass              $params   The parameters
  * @param   ContentTypeInterface[] $elements Content elements
  */
 public function __construct($title, $id, $params, $elements = [])
 {
     parent::__construct($title, $id, $params);
     foreach ($elements as $element) {
         $this->add($element);
     }
 }
コード例 #2
0
ファイル: Link.php プロジェクト: nibra/joomla-pythagoras
 /**
  * Link constructor.
  *
  */
 public function __construct($href, $text)
 {
     parent::__construct('Link', 'link-' . spl_object_hash($this), new \stdClass());
     $this->href = $href;
     $this->text = $text;
 }
コード例 #3
0
ファイル: Article.php プロジェクト: nibra/joomla-pythagoras
 /**
  * Article constructor.
  *
  * @param   object  $item  The article
  */
 public function __construct($item)
 {
     parent::__construct($item->title, $item->alias, new \stdClass());
     $this->article = $item;
 }
コード例 #4
0
ファイル: Image.php プロジェクト: nibra/joomla-pythagoras
 /**
  * Image constructor.
  *
  * @param   ImageEntity $item The location of the image file
  * @param   string      $alt  The alternative description
  */
 public function __construct(ImageEntity $item, $alt = '')
 {
     parent::__construct($item->caption, 'img-' . spl_object_hash($this), new \stdClass());
     $this->image = $item;
     $this->alt = $alt;
 }
コード例 #5
0
ファイル: Span.php プロジェクト: nibra/joomla-pythagoras
 /**
  * Paragraph constructor.
  *
  * @param   string  $text    The copy of the paragraph
  */
 public function __construct($text)
 {
     parent::__construct('Span', 'span-' . spl_object_hash($this), new \stdClass());
     $this->text = $text;
 }
コード例 #6
0
ファイル: Icon.php プロジェクト: nibra/joomla-pythagoras
 /**
  * Icon constructor.
  *
  * @param $name
  */
 public function __construct($name)
 {
     parent::__construct($name, 'icon-' . spl_object_hash($this), new \stdClass());
     $this->name = $name;
 }
コード例 #7
0
 /**
  * DefaultMenu constructor.
  *
  * @param   object $item The item to be displayed as a menu
  */
 public function __construct($item)
 {
     parent::__construct('Menu', 'menu-' . spl_object_hash($this), new \stdClass());
     $this->item = $item;
 }
コード例 #8
0
 /**
  * Attribution constructor.
  *
  * @param   string $label The text before the author's name
  * @param   string $name  The author's name
  */
 public function __construct($label, $name)
 {
     parent::__construct($label, 'lbl-' . spl_object_hash($this), new \stdClass());
     $this->label = $label;
     $this->name = $name;
 }
コード例 #9
0
ファイル: Headline.php プロジェクト: nibra/joomla-pythagoras
 /**
  * Headline constructor.
  *
  * @param   string  $text  The copy of the headline
  * @param   integer $level The Level of the headline
  */
 public function __construct($text, $level = 1)
 {
     parent::__construct($text, 'headline-' . spl_object_hash($this), new \stdClass());
     $this->text = $text;
     $this->level = $level;
 }
コード例 #10
0
ファイル: Paragraph.php プロジェクト: nibra/joomla-pythagoras
 /**
  * Paragraph constructor.
  *
  * @param   string  $text    The copy of the paragraph
  * @param   integer $variant Emphasis variant, see class constants
  */
 public function __construct($text, $variant = self::PLAIN)
 {
     parent::__construct('Paragraph', 'paragraph-' . spl_object_hash($this), new \stdClass());
     $this->text = $text;
     $this->variant = $variant;
 }