[comment]: # ({cd4a930c-cd4a930c})
# עדכון שירות

[comment]: # ({/cd4a930c-cd4a930c})

[comment]: # ({8729c1df-79afe9b7})
### תיאור

`object service.update(שירותי אובייקט/מערך)`

שיטה זו מאפשרת לעדכן שירותים קיימים.

::: noteclassic
שיטה זו זמינה למשתמשים מכל סוג. הרשאות
כדי לקרוא את השיטה ניתן לבטל בהגדרות תפקיד המשתמש. ראה [משתמש
תפקידים](/manual/web_interface/frontend_sections/administration/user_roles)
למידע נוסף.
:::

[comment]: # ({/8729c1df-79afe9b7})

[comment]: # ({new-5fb5ebb3})
### Parameters

`(object/array)` service properties to be updated.

The `serviceid` property must be defined for each service, all other
properties are optional. Only the passed properties will be updated, all
others will remain unchanged.

Additionally to the [standard service properties](object#service), the
method accepts the following parameters.

|Parameter|[Type](/manual/api/reference_commentary#data_types)| Description|
|--|--|------|
|children|array|Child services to replace the current service children.<br><br>The children must have the `serviceid` property defined.|
|parents|array|Parent services to replace the current service parents.<br><br>The parents must have the `serviceid` property defined.|
|tags|array|Service [tags](/manual/api/reference/service/object#service_tag) to replace the current service tags.|
|problem\_tags|array|[Problem tags](/manual/api/reference/service/object#problem_tag) to replace the current problem tags.|
|status\_rules|array|[Status rules](/manual/api/reference/service/object#status_rule) to replace the current status rules.|

[comment]: # ({/new-5fb5ebb3})

[comment]: # ({9465ee4d-9465ee4d})
### החזר ערכים

`(אובייקט)` מחזירה אובייקט המכיל את המזהים של השירותים המעודכנים
מתחת לנכס `serviceids`.

[comment]: # ({/9465ee4d-9465ee4d})

[comment]: # ({b41637d2-b41637d2})
### דוגמאות

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({8b4ab02e-b9918036})
#### הגדרת האב לשירות

הפוך שירות עם מזהה "3" להיות האב לשירות עם תעודת זהות "5".

בַּקָשָׁה:

``` json
{
     "jsonrpc": "2.0",
     "method": "service.update",
     "params": {
         "serviceid": "5",
         "הורים": [
             {
                 "serviceid": "3"
             }
         ]
     },
     "auth": "038e1d7b1735c6a5436ee9eae095879e",
     "מזהה": 1
}
```

תְגוּבָה:

``` json
{
     "jsonrpc": "2.0",
     "תוצאה": {
         "serviceids": [
             "5"
         ]
     },
     "מזהה": 1
}
```

[comment]: # ({/8b4ab02e-b9918036})

[comment]: # ({6f1510d5-263b1baa})
#### הוספת זמן השבתה מתוזמן

הוסף זמן השבתה לשירות עם מזהה "4" המתוכנן מדי שבוע מיום שני
22:00 עד יום שלישי 10:00.

בַּקָשָׁה:

``` json
{
     "jsonrpc": "2.0",
     "method": "service.update",
     "params": {
         "serviceid": "4",
         "פעמים": [
             {
                 "סוג 1",
                 "ts_from": "165600",
                 "ts_to": "201600"
             }
         ]
     },
     "auth": "038e1d7b1735c6a5436ee9eae095879e",
     "מזהה": 1
}
```

תְגוּבָה:

``` json
{
     "jsonrpc": "2.0",
     "תוצאה": {
         "serviceids": [
             "4"
         ]
     },
     "מזהה": 1
}
```

[comment]: # ({/6f1510d5-263b1baa})

[comment]: # ({fd1b6894-fd1b6894})
### מקור

CService::update()‎ בתוך *ui/include/classes/api/services/CService.php*.

[comment]: # ({/fd1b6894-fd1b6894})
