src/Sulu/Bundle/ContactBundle/Controller/AccountController.php
protected function doPut(AccountInterface $account, Request $request)
    {
        $account->setName($request->get('name'));
        $account->setCorporation($request->get('corporation'));
        $accountManager = $this->getAccountManager();

        if (null !== $request->get('uid')) {
            $account->setUid($request->get('uid'));
        }

        if (null !== $request->get('note')) {
            $account->setNote($request->get('note'));
        }

        $logo = $request->get('logo', []);
        if ($logo && array_key_exists('id', $logo)) {
            $accountManager->setLogo($account, $request->get('logo')['id']);
        }

        $this->setParent($request->get('parent'), $account);

        $user = $this->getUser();
        $account->setChanger($user);

        // Process details
        if (!($accountManager->processUrls($account, $request->get('urls', []))
            && $accountManager->processEmails($account, $request->get('emails', []))
            && $accountManager->processFaxes($account, $request->get('faxes', []))
            && $accountManager->processSocialMediaProfiles($account, $request->get('socialMediaProfiles', []))
            && $accountManager->processPhones($account, $request->get('phones', []))
            && $accountManager->processAddresses($account, $request->get('addresses', []))
            && $accountManager->processTags($account, $request->get('tags', []))
            && $accountManager->processNotes($account, $request->get('notes', []))
            && $accountManager->processCategories($account, $request->get('categories', []))
            && $accountManager->processBankAccounts($account, $request->get('bankAccounts', [])))
        ) {
            throw new RestException('Updating dependencies is not possible', 0);
        }
    }
protected function doPut(AccountInterface $account, Request $request)
    {
        $account->setName($request->get('name'));
        $account->setCorporation($request->get('corporation'));
        $accountManager = $this->getAccountManager();

        if (null !== $request->get('uid')) {
            $account->setUid($request->get('uid'));
        }

        if (null !== $request->get('note')) {
            $account->setNote($request->get('note'));
        }

        $logo = $request->get('logo', []);
        if ($logo && array_key_exists('id', $logo)) {
            $accountManager->setLogo($account, $request->get('logo')['id']);
        }

        $this->setParent($request->get('parent'), $account);

        $user = $this->getUser();
        $account->setChanger($user);

        // Process details
        if (!($accountManager->processUrls($account, $request->get('urls', []))
            && $accountManager->processEmails($account, $request->get('emails', []))
            && $accountManager->processFaxes($account, $request->get('faxes', []))
            && $accountManager->processSocialMediaProfiles($account, $request->get('socialMediaProfiles', []))
            && $accountManager->processPhones($account, $request->get('phones', []))
            && $accountManager->processAddresses($account, $request->get('addresses', []))
            && $accountManager->processTags($account, $request->get('tags', []))
            && $accountManager->processNotes($account, $request->get('notes', []))
            && $accountManager->processCategories($account, $request->get('categories', []))
            && $accountManager->processBankAccounts($account, $request->get('bankAccounts', [])))
        ) {
            throw new RestException('Updating dependencies is not possible', 0);
        }
    }
protected function doPut ( AccountInterface $ account , Request $ request ) { $ account -> setName ( $ request -> get ( 'name' ) ) ; $ account -> setCorporation ( $ request -> get ( 'corporation' ) ) ; $ accountManager = $ this -> getAccountManager ( ) ; if ( null !== $ request -> get ( 'uid' ) ) { $ account -> setUid ( $ request -> get ( 'uid' ) ) ; } if ( null !== $ request -> get ( 'note' ) ) { $ account -> setNote ( $ request -> get ( 'note' ) ) ; } $ logo = $ request -> get ( 'logo' , [ ] ) ; if ( $ logo && array_key_exists ( 'id' , $ logo ) ) { $ accountManager -> setLogo ( $ account , $ request -> get ( 'logo' ) [ 'id' ] ) ; } $ this -> setParent ( $ request -> get ( 'parent' ) , $ account ) ; $ user = $ this -> getUser ( ) ; $ account -> setChanger ( $ user ) ; // Process details if ( ! ( $ accountManager -> processUrls ( $ account , $ request -> get ( 'urls' , [ ] ) ) && $ accountManager -> processEmails ( $ account , $ request -> get ( 'emails' , [ ] ) ) && $ accountManager -> processFaxes ( $ account , $ request -> get ( 'faxes' , [ ] ) ) && $ accountManager -> processSocialMediaProfiles ( $ account , $ request -> get ( 'socialMediaProfiles' , [ ] ) ) && $ accountManager -> processPhones ( $ account , $ request -> get ( 'phones' , [ ] ) ) && $ accountManager -> processAddresses ( $ account , $ request -> get ( 'addresses' , [ ] ) ) && $ accountManager -> processTags ( $ account , $ request -> get ( 'tags' , [ ] ) ) && $ accountManager -> processNotes ( $ account , $ request -> get ( 'notes' , [ ] ) ) && $ accountManager -> processCategories ( $ account , $ request -> get ( 'categories' , [ ] ) ) && $ accountManager -> processBankAccounts ( $ account , $ request -> get ( 'bankAccounts' , [ ] ) ) ) ) { throw new RestException ( 'Updating dependencies is not possible' , 0 ) ; } }
processes given entity for put.

@param AccountInterface $account
@param Request $request

@throws EntityNotFoundException
@throws RestException
processes given entity for put .