mediawiki-extensions-Echo/includes/Mapper/TargetPageMapper.php
Reedy c85fe25fe7 Namespace Mapper
Change-Id: I8a02082466ef39db32ffa7562b02db61929346cd
2022-11-04 18:05:34 +00:00

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