mediawiki-extensions-Echo/includes/Mapper/TargetPageMapper.php
Umherirrender aa41e1e292 Migrate to IDatabase::newInsertQueryBuilder/newUpdateQueryBuilder
UpdateQueryBuilder does not return a value,
removed the return value from the functions as well,
deprecated since 1.33

Change-Id: I3b934a5e6d5a53c07ec5233da00d9f53ba7bae92
2024-04-13 22:51:32 +02:00

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