mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-24 07:54:13 +00:00
aa41e1e292
UpdateQueryBuilder does not return a value, removed the return value from the functions as well, deprecated since 1.33 Change-Id: I3b934a5e6d5a53c07ec5233da00d9f53ba7bae92
41 lines
773 B
PHP
41 lines
773 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->newInsertQueryBuilder()
|
|
->insertInto( 'echo_target_page' )
|
|
->row( $row )
|
|
->caller( __METHOD__ )
|
|
->execute();
|
|
|
|
return true;
|
|
}
|
|
}
|