OperationalAdjustmentsRelateToRulesPointsService.php 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace common\services;
  3. use common\models\OperationalAdjustmentsRelateToRulesPoints;
  4. use common\models\OperationalAdjustments;
  5. class OperationalAdjustmentsRelateToRulesPointsService
  6. {
  7. public static function getListByOperationalAdjustmentsId($emergencyResponseId)
  8. {
  9. return OperationalAdjustmentsRelateToRulesPoints::find()->where(["and", ["operational_adjustments_id" => $emergencyResponseId], [">", "rules_point_id", 0]])->all();
  10. }
  11. public static function add(OperationalAdjustments $OperationalAdjustments): void
  12. {
  13. RulesPointsRelationshipService::addOperationalAdjustmentsRelationship($OperationalAdjustments);
  14. }
  15. public static function update(OperationalAdjustments $OperationalAdjustments): void
  16. {
  17. RulesPointsRelationshipService::updateOperationalAdjustmentsRelationship($OperationalAdjustments);
  18. }
  19. public static function deleteByOperationalAdjustmentsId($OperationalAdjustmentsId): void
  20. {
  21. OperationalAdjustmentsRelateToRulesPoints::deleteAll(["operational_adjustments_id" => $OperationalAdjustmentsId]);
  22. }
  23. }