Scalr\Api\Service\User\V1beta0\Controller\Events::modifyAction PHP Метод

modifyAction() публичный Метод

Modifies event from current scope
public modifyAction ( string $eventId ) : Scalr\Api\DataType\ResultEnvelope
$eventId string Unique identifier of the Event
Результат Scalr\Api\DataType\ResultEnvelope
    public function modifyAction($eventId)
    {
        $this->checkPermissions(Acl::RESOURCE_GENERAL_CUSTOM_EVENTS, Acl::PERM_GENERAL_CUSTOM_EVENTS_MANAGE);
        $object = $this->request->getJsonBody();
        $eventAdapter = $this->adapter('event');
        //Pre validates the request object
        $eventAdapter->validateObject($object, Request::METHOD_PATCH);
        $event = $this->getEvent($eventId, true);
        //Copies all alterable properties to fetched Role Entity
        $eventAdapter->copyAlterableProperties($object, $event);
        //Re-validates an Entity
        $eventAdapter->validateEntity($event);
        //Saves verified results
        $event->save();
        return $this->result($eventAdapter->toData($event));
    }