Mickhail M | 2d28892 | 2015-03-20 16:01:26 +0300 | [diff] [blame] | 1 | <?php |
| 2 | namespace deka6pb\autoparser\components; |
| 3 | |
| 4 | trait TItemStatus { |
| 5 | public function setNew() { |
| 6 | $this->setScenario($this::SCENARIO_INSERT); |
| 7 | $this->status = self::STATUS_NEW; |
| 8 | return $this->save(); |
| 9 | } |
| 10 | |
| 11 | public function setPublished() { |
| 12 | $this->setScenario($this::SCENARIO_UPDATE); |
| 13 | $this->status = self::STATUS_PUBLISHED; |
| 14 | return $this->update(); |
| 15 | } |
| 16 | |
| 17 | public function setStopped() { |
| 18 | $this->setScenario($this::SCENARIO_UPDATE); |
| 19 | $this->status = self::STATUS_STOPPED; |
| 20 | return $this->update(); |
| 21 | } |
| 22 | } |