mediawiki-extensions-Echo/includes/mapper/TargetPageMapper.php
libraryupgrader b3f948c59c build: Updating composer dependencies
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0
* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0

Change-Id: I4b2fb7f46b6c0a5c33a6ad25f085de8ae13eb084
2021-05-04 09:05:15 -07:00

33 lines
618 B
PHP

<?php
/**
* Database mapper for EchoTargetPage model
*/
class EchoTargetPageMapper extends EchoAbstractMapper {
/**
* 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;
}
}