You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 line
712B

  1. <?php
  2. namespace common\logic;
  3. use yii\base\Model;
  4. use yii\db\ActiveRecord;
  5. abstract class AbstractBuilder extends AbstractService implements BuilderInterface
  6. {
  7. public function create(Model $model): bool
  8. {
  9. return $model->save();
  10. }
  11. public function update(Model $model): bool
  12. {
  13. return $model->save();
  14. }
  15. public function delete(Model $model): bool
  16. {
  17. return $model->delete();
  18. }
  19. /**
  20. * @deprecated
  21. */
  22. public function saveCreate(ActiveRecord $model): bool
  23. {
  24. return $model->save();
  25. }
  26. /**
  27. * @deprecated
  28. */
  29. public function saveUpdate(ActiveRecord $model): bool
  30. {
  31. return $model->save();
  32. }
  33. }