Scalr\Api\Service\Account\V1beta0\Controller\Teams::modifyAction PHP Метод

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

Change Account Team attributes.
public modifyAction ( integer $teamId ) : Scalr\Api\DataType\ResultEnvelope
$teamId integer Identifier of the Team
Результат Scalr\Api\DataType\ResultEnvelope
    public function modifyAction($teamId)
    {
        if (!$this->getUser()->canManageAcl()) {
            throw new ApiInsufficientPermissionsException();
        }
        $object = $this->request->getJsonBody();
        /* @var $teamAdapter TeamAdapter */
        $teamAdapter = $this->adapter('team');
        //Pre validates the request object
        $teamAdapter->validateObject($object, Request::METHOD_PATCH);
        $team = $this->getTeam($teamId);
        //Copies all alterable properties to fetched Role Entity
        $teamAdapter->copyAlterableProperties($object, $team);
        //Re-validates an Entity
        $teamAdapter->validateEntity($team);
        //Saves verified results
        $team->save();
        return $this->result($teamAdapter->toData($team));
    }