2014-08-06 00:16:10 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Database mapper for EchoTargetPage model
|
|
|
|
*/
|
|
|
|
class EchoTargetPageMapper extends EchoAbstractMapper {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* List of db fields used to construct an EchoTargetPage model
|
|
|
|
* @var string[]
|
|
|
|
*/
|
2016-12-05 18:51:07 +00:00
|
|
|
protected static $fields = [
|
2014-08-06 00:16:10 +00:00
|
|
|
'etp_page',
|
|
|
|
'etp_event'
|
2016-12-05 18:51:07 +00:00
|
|
|
];
|
2014-08-06 00:16:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Insert an EchoTargetPage instance into the database
|
|
|
|
*
|
|
|
|
* @param EchoTargetPage $targetPage
|
2017-07-26 19:34:44 +00:00
|
|
|
* @return bool
|
2014-08-06 00:16:10 +00:00
|
|
|
*/
|
|
|
|
public function insert( EchoTargetPage $targetPage ) {
|
|
|
|
$dbw = $this->dbFactory->getEchoDb( DB_MASTER );
|
|
|
|
|
|
|
|
$row = $targetPage->toDbArray();
|
|
|
|
|
|
|
|
$res = $dbw->insert( 'echo_target_page', $row, __METHOD__ );
|
|
|
|
|
|
|
|
return $res;
|
|
|
|
}
|
|
|
|
}
|