2022-12-07 01:05:22 +00:00
|
|
|
<?php
|
|
|
|
namespace MediaWiki\Skins\Vector\Components;
|
|
|
|
|
|
|
|
/**
|
2022-12-14 20:42:52 +00:00
|
|
|
* VectorComponentPinnableContainer component
|
|
|
|
* To be used with PinnableContainer/Pinned or PinnableContainer/Unpinned templates.
|
2022-12-07 01:05:22 +00:00
|
|
|
*/
|
2022-12-14 20:42:52 +00:00
|
|
|
class VectorComponentPinnableContainer implements VectorComponent {
|
2022-12-07 01:05:22 +00:00
|
|
|
/** @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,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|