mediawiki-skins-Vector/includes/Components/VectorComponentPinnableContainer.php
bwang 3ad3d70745 Rename VectorComponentPinnedContainer to VectorComponentPinnableContainer to match template files
Bug: T317900
Change-Id: I557fbef46fd1ea5984ded7f1a067cc43656e7076
2022-12-15 22:46:46 +00:00

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,
];
}
}