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