mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-03 11:57:13 +00:00
c85fe25fe7
Change-Id: I8a02082466ef39db32ffa7562b02db61929346cd
37 lines
684 B
PHP
37 lines
684 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\Notifications\Mapper;
|
|
|
|
use EchoTargetPage;
|
|
|
|
/**
|
|
* Database mapper for EchoTargetPage model
|
|
*/
|
|
class TargetPageMapper extends AbstractMapper {
|
|
|
|
/**
|
|
* List of db fields used to construct an EchoTargetPage model
|
|
* @var string[]
|
|
*/
|
|
protected static $fields = [
|
|
'etp_page',
|
|
'etp_event'
|
|
];
|
|
|
|
/**
|
|
* Insert an EchoTargetPage instance into the database
|
|
*
|
|
* @param EchoTargetPage $targetPage
|
|
* @return bool
|
|
*/
|
|
public function insert( EchoTargetPage $targetPage ) {
|
|
$dbw = $this->dbFactory->getEchoDb( DB_PRIMARY );
|
|
|
|
$row = $targetPage->toDbArray();
|
|
|
|
$dbw->insert( 'echo_target_page', $row, __METHOD__ );
|
|
|
|
return true;
|
|
}
|
|
}
|