public function createAccountsFromSegmentation($segmentation)
    {
        $segments = explode(':', $segmentation);

        $account = $this->oh->getOrganization()->getChartOfAccounts();

        foreach ($segments as $segment) {
            $parent = $account;

            if (!$account = $account->getChildForName($segment)) {
                $account = new $this->accountFqcn($segment);
                $parent->addChild($account);
            }
        }

        return $account;
    }
public function createAccountsFromSegmentation($segmentation)
    {
        $segments = explode(':', $segmentation);

        $account = $this->oh->getOrganization()->getChartOfAccounts();

        foreach ($segments as $segment) {
            $parent = $account;

            if (!$account = $account->getChildForName($segment)) {
                $account = new $this->accountFqcn($segment);
                $parent->addChild($account);
            }
        }

        return $account;
    }
public function createAccountsFromSegmentation ( $ segmentation ) { $ segments = explode ( ':' , $ segmentation ) ; $ account = $ this -> oh -> getOrganization ( ) -> getChartOfAccounts ( ) ; foreach ( $ segments as $ segment ) { $ parent = $ account ; if ( ! $ account = $ account -> getChildForName ( $ segment ) ) { $ account = new $ this -> accountFqcn ( $ segment ) ; $ parent -> addChild ( $ account ) ; } } return $ account ; }
Create Account tree from segmentation

@author Tom Haskins-Vaughan <tom@tomhv.uk>
@since  0.8.0

@param  AccountInterface    $chart
@param  AccountSegmentation $segmentation
Create Account tree from segmentation