src/Sulu/Bundle/ContactBundle/Controller/AccountController.php
private function setParent($parentData, AccountInterface $account)
    {
        if (null != $parentData && isset($parentData['id']) && 'null' != $parentData['id'] && '' != $parentData['id']) {
            $parent = $this->getRepository()->findAccountById($parentData['id']);
            if (!$parent) {
                throw new EntityNotFoundException($this->getAccountEntityName(), $parentData['id']);
            }
            $account->setParent($parent);
        } else {
            $account->setParent(null);
        }
    }
private function setParent($parentData, AccountInterface $account)
    {
        if (null != $parentData && isset($parentData['id']) && 'null' != $parentData['id'] && '' != $parentData['id']) {
            $parent = $this->getRepository()->findAccountById($parentData['id']);
            if (!$parent) {
                throw new EntityNotFoundException($this->getAccountEntityName(), $parentData['id']);
            }
            $account->setParent($parent);
        } else {
            $account->setParent(null);
        }
    }
private function setParent ( $ parentData , AccountInterface $ account ) { if ( null != $ parentData && isset ( $ parentData [ 'id' ] ) && 'null' != $ parentData [ 'id' ] && '' != $ parentData [ 'id' ] ) { $ parent = $ this -> getRepository ( ) -> findAccountById ( $ parentData [ 'id' ] ) ; if ( ! $ parent ) { throw new EntityNotFoundException ( $ this -> getAccountEntityName ( ) , $ parentData [ 'id' ] ) ; } $ account -> setParent ( $ parent ) ; } else { $ account -> setParent ( null ) ; } }
Set parent to account.

@param array $parentData
@param AccountInterface $account

@throws \Sulu\Component\Rest\Exception\EntityNotFoundException
Set parent to account .