| @@ 1235-1258 (lines=24) @@ | ||
| 1232 | $mailService->send($message); |
|
| 1233 | } |
|
| 1234 | ||
| 1235 | public function postFbWall($secretKey, $game, $user, $entry) |
|
| 1236 | { |
|
| 1237 | $topic = $game->getTitle(); |
|
| 1238 | ||
| 1239 | $shares = json_decode($entry->getSocialShares(), true); |
|
| 1240 | if (!isset($shares['fbwall'])) { |
|
| 1241 | $shares['fbwall'] = 1; |
|
| 1242 | } else { |
|
| 1243 | $shares['fbwall'] += 1; |
|
| 1244 | } |
|
| 1245 | $sharesJson = json_encode($shares); |
|
| 1246 | $entry->setSocialShares($sharesJson); |
|
| 1247 | $entry = $this->getEntryMapper()->update($entry); |
|
| 1248 | ||
| 1249 | $this->getEventManager()->trigger(__FUNCTION__ . '.post', $this, array( |
|
| 1250 | 'user' => $user, |
|
| 1251 | 'game' => $game, |
|
| 1252 | 'secretKey' => $secretKey, |
|
| 1253 | 'topic' => $topic, |
|
| 1254 | 'entry' => $entry |
|
| 1255 | )); |
|
| 1256 | ||
| 1257 | return true; |
|
| 1258 | } |
|
| 1259 | ||
| 1260 | public function postFbRequest($secretKey, $game, $user, $entry, $to) |
|
| 1261 | { |
|
| @@ 1284-1307 (lines=24) @@ | ||
| 1281 | return true; |
|
| 1282 | } |
|
| 1283 | ||
| 1284 | public function postTwitter($secretKey, $game, $user, $entry) |
|
| 1285 | { |
|
| 1286 | $topic = $game->getTitle(); |
|
| 1287 | ||
| 1288 | $shares = json_decode($entry->getSocialShares(), true); |
|
| 1289 | if (!isset($shares['fbrequest'])) { |
|
| 1290 | $shares['tweet'] = 1; |
|
| 1291 | } else { |
|
| 1292 | $shares['tweet'] += 1; |
|
| 1293 | } |
|
| 1294 | $sharesJson = json_encode($shares); |
|
| 1295 | $entry->setSocialShares($sharesJson); |
|
| 1296 | $entry = $this->getEntryMapper()->update($entry); |
|
| 1297 | ||
| 1298 | $this->getEventManager()->trigger(__FUNCTION__ . '.post', $this, array( |
|
| 1299 | 'user' => $user, |
|
| 1300 | 'game' => $game, |
|
| 1301 | 'secretKey' => $secretKey, |
|
| 1302 | 'topic' => $topic, |
|
| 1303 | 'entry' => $entry |
|
| 1304 | )); |
|
| 1305 | ||
| 1306 | return true; |
|
| 1307 | } |
|
| 1308 | ||
| 1309 | public function postGoogle($secretKey, $game, $user, $entry) |
|
| 1310 | { |
|
| @@ 1309-1332 (lines=24) @@ | ||
| 1306 | return true; |
|
| 1307 | } |
|
| 1308 | ||
| 1309 | public function postGoogle($secretKey, $game, $user, $entry) |
|
| 1310 | { |
|
| 1311 | $topic = $game->getTitle(); |
|
| 1312 | ||
| 1313 | $shares = json_decode($entry->getSocialShares(), true); |
|
| 1314 | if (!isset($shares['fbrequest'])) { |
|
| 1315 | $shares['google'] = 1; |
|
| 1316 | } else { |
|
| 1317 | $shares['google'] += 1; |
|
| 1318 | } |
|
| 1319 | $sharesJson = json_encode($shares); |
|
| 1320 | $entry->setSocialShares($sharesJson); |
|
| 1321 | $entry = $this->getEntryMapper()->update($entry); |
|
| 1322 | ||
| 1323 | $this->getEventManager()->trigger(__FUNCTION__ . '.post', $this, array( |
|
| 1324 | 'user' => $user, |
|
| 1325 | 'game' => $game, |
|
| 1326 | 'secretKey' => $secretKey, |
|
| 1327 | 'topic' => $topic, |
|
| 1328 | 'entry' => $entry |
|
| 1329 | )); |
|
| 1330 | ||
| 1331 | return true; |
|
| 1332 | } |
|
| 1333 | ||
| 1334 | /** |
|
| 1335 | * Is it possible to trigger a bonus entry ? |
|