mediawiki-extensions-Echo/includes/Mapper/TargetPageMapper.php
Reedy 5611662f06 Namespace Model
Depends-On: Id28792658de950b99a8786f881563476def59eba
Change-Id: Ib57ea2db947285946f31fa9912b37181044df9d3
2022-11-10 14:25:42 -07:00

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