public function exec($request)
    {
        assert($request instanceof ARequest);
        /** define local working data */
        $typeCode = $request->getAssetTypeCode();
        $typeId = $request->getAssetTypeId();
        $custId = $request->getCustomerId();
        $isSys = $request->getIsSystem();

        /** perform processing */
        if (is_null($typeId)) {
            /* get type ID by code if missed */
            $typeId = $this->daoTypeAsset->getIdByCode($typeCode);
        }

        /* return cached data for system customer if exists */
        if (
            $isSys &&
            isset($this->cachedSysAccs[$typeId])
        ) {
            $result = $this->cachedSysAccs[$typeId];
        } else {
            /* ... or get data from DB */
            if ($isSys) {
                /* get system customer ID */
                $custId = $this->daoAccount->getSystemCustomerId();
            }
            $account = $this->getAccount($custId, $typeId);
            $result = $this->composeResult($account);
            /* cache data for system customer */
            if ($isSys) {
                $this->cachedSysAccs[$typeId] = $result;
            }
        }

        /** compose result */
        return $result;
    }
public function exec($request)
    {
        assert($request instanceof ARequest);
        /** define local working data */
        $typeCode = $request->getAssetTypeCode();
        $typeId = $request->getAssetTypeId();
        $custId = $request->getCustomerId();
        $isSys = $request->getIsSystem();

        /** perform processing */
        if (is_null($typeId)) {
            /* get type ID by code if missed */
            $typeId = $this->daoTypeAsset->getIdByCode($typeCode);
        }

        /* return cached data for system customer if exists */
        if (
            $isSys &&
            isset($this->cachedSysAccs[$typeId])
        ) {
            $result = $this->cachedSysAccs[$typeId];
        } else {
            /* ... or get data from DB */
            if ($isSys) {
                /* get system customer ID */
                $custId = $this->daoAccount->getSystemCustomerId();
            }
            $account = $this->getAccount($custId, $typeId);
            $result = $this->composeResult($account);
            /* cache data for system customer */
            if ($isSys) {
                $this->cachedSysAccs[$typeId] = $result;
            }
        }

        /** compose result */
        return $result;
    }
public function exec ( $ request ) { assert ( $ request instanceof ARequest ) ; /** define local working data */ $ typeCode = $ request -> getAssetTypeCode ( ) ; $ typeId = $ request -> getAssetTypeId ( ) ; $ custId = $ request -> getCustomerId ( ) ; $ isSys = $ request -> getIsSystem ( ) ; /** perform processing */ if ( is_null ( $ typeId ) ) { /* get type ID by code if missed */ $ typeId = $ this -> daoTypeAsset -> getIdByCode ( $ typeCode ) ; } /* return cached data for system customer if exists */ if ( $ isSys && isset ( $ this -> cachedSysAccs [ $ typeId ] ) ) { $ result = $ this -> cachedSysAccs [ $ typeId ] ; } else { /* ... or get data from DB */ if ( $ isSys ) { /* get system customer ID */ $ custId = $ this -> daoAccount -> getSystemCustomerId ( ) ; } $ account = $ this -> getAccount ( $ custId , $ typeId ) ; $ result = $ this -> composeResult ( $ account ) ; /* cache data for system customer */ if ( $ isSys ) { $ this -> cachedSysAccs [ $ typeId ] = $ result ; } } /** compose result */ return $ result ; }
Get account data or create new account if customer has no account for the requested asset.

@param ARequest $request

@return AResponse
Get account data or create new account if customer has no account for the requested asset .