mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-12-22 12:42:43 +00:00
3ad3d70745
Bug: T317900 Change-Id: I557fbef46fd1ea5984ded7f1a067cc43656e7076
33 lines
660 B
PHP
33 lines
660 B
PHP
<?php
|
|
namespace MediaWiki\Skins\Vector\Components;
|
|
|
|
/**
|
|
* VectorComponentPinnableContainer component
|
|
* To be used with PinnableContainer/Pinned or PinnableContainer/Unpinned templates.
|
|
*/
|
|
class VectorComponentPinnableContainer implements VectorComponent {
|
|
/** @var string */
|
|
private $id;
|
|
/** @var bool */
|
|
private $isPinned;
|
|
|
|
/**
|
|
* @param string $id
|
|
* @param bool $isPinned
|
|
*/
|
|
public function __construct( string $id, bool $isPinned = true ) {
|
|
$this->id = $id;
|
|
$this->isPinned = $isPinned;
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public function getTemplateData(): array {
|
|
return [
|
|
'id' => $this->id,
|
|
'is-pinned' => $this->isPinned,
|
|
];
|
|
}
|
|
}
|