12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- namespace Ppb\Db\Table\Row;
- class Advert extends AbstractRow
- {
-
- public function addView()
- {
- $nbViews = $this->getData('nb_views') + 1;
- $this->save(array(
- 'nb_views' => $nbViews,
- ));
- return $this;
- }
-
- public function addClick()
- {
- $nbClicks = $this->getData('nb_clicks') + 1;
- $this->save(array(
- 'nb_clicks' => $nbClicks,
- ));
- return $this;
- }
-
- public function link()
- {
- return array(
- 'module' => 'app',
- 'controller' => 'index',
- 'action' => 'advert-redirect',
- 'id' => $this->getData('id')
- );
- }
- }
|