EmergencyResponseRelateToRulesPointsService.php 1008 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace common\services;
  3. use common\models\EmergencyResponseRelateToRulesPoints;
  4. use common\models\EmergencyResponse;
  5. class EmergencyResponseRelateToRulesPointsService
  6. {
  7. public static function getListByEmergencyResponseId($emergencyResponseId)
  8. {
  9. return EmergencyResponseRelateToRulesPoints::find()->where(["and", ["emergency_response_id" => $emergencyResponseId], [">", "rules_point_id", 0]])->all();
  10. }
  11. public static function add(EmergencyResponse $EmergencyResponse): void
  12. {
  13. RulesPointsRelationshipService::addEmergencyResponseRelationship($EmergencyResponse);
  14. }
  15. public static function update(EmergencyResponse $EmergencyResponse): void
  16. {
  17. RulesPointsRelationshipService::updateEmergencyResponseRelationship($EmergencyResponse);
  18. }
  19. public static function deleteByEmergencyResponseId($EmergencyResponseId)
  20. {
  21. EmergencyResponseRelateToRulesPoints::deleteAll(["emergency_response_id" => $EmergencyResponseId]);
  22. }
  23. }