mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-03 03:47:16 +00:00
33 lines
632 B
PHP
33 lines
632 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 = array(
|
||
|
'etp_page',
|
||
|
'etp_event'
|
||
|
);
|
||
|
|
||
|
/**
|
||
|
* Insert an EchoTargetPage instance into the database
|
||
|
*
|
||
|
* @param EchoTargetPage $targetPage
|
||
|
* @return boolean
|
||
|
*/
|
||
|
public function insert( EchoTargetPage $targetPage ) {
|
||
|
$dbw = $this->dbFactory->getEchoDb( DB_MASTER );
|
||
|
|
||
|
$row = $targetPage->toDbArray();
|
||
|
|
||
|
$res = $dbw->insert( 'echo_target_page', $row, __METHOD__ );
|
||
|
|
||
|
return $res;
|
||
|
}
|
||
|
}
|