| 1 |
<?php |
| 2 |
|
| 3 |
namespace MediaWiki\Extension\Notifications\Mapper; |
| 4 |
|
| 5 |
use MediaWiki\Extension\Notifications\Model\TargetPage; |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
class TargetPageMapper extends AbstractMapper { |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
protected static $fields = [ |
| 17 |
'etp_page', |
| 18 |
'etp_event' |
| 19 |
]; |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
public function insert( TargetPage $targetPage ) { |
| 28 |
$dbw = $this->dbFactory->getEchoDb( DB_PRIMARY ); |
| 29 |
|
| 30 |
$row = $targetPage->toDbArray(); |
| 31 |
|
| 32 |
$dbw->newInsertQueryBuilder() |
| 33 |
->insertInto( 'echo_target_page' ) |
| 34 |
->row( $row ) |
| 35 |
->caller( __METHOD__ ) |
| 36 |
->execute(); |
| 37 |
|
| 38 |
return true; |
| 39 |
} |
| 40 |
} |