public function getCustomAssetBalance(Asset $asset)
    {
        foreach ($this->getBalances() as $balance) {
            if ($balance->getAssetCode() !== $asset->getAssetCode()) continue;
            if ($balance->getAssetIssuerAccountId() != $asset->getIssuer()->getAccountIdString()) continue;

            return $balance;
        }

        return null;
    }
public function getCustomAssetBalance(Asset $asset)
    {
        foreach ($this->getBalances() as $balance) {
            if ($balance->getAssetCode() !== $asset->getAssetCode()) continue;
            if ($balance->getAssetIssuerAccountId() != $asset->getIssuer()->getAccountIdString()) continue;

            return $balance;
        }

        return null;
    }
public function getCustomAssetBalance ( Asset $ asset ) { foreach ( $ this -> getBalances ( ) as $ balance ) { if ( $ balance -> getAssetCode ( ) !== $ asset -> getAssetCode ( ) ) continue ; if ( $ balance -> getAssetIssuerAccountId ( ) != $ asset -> getIssuer ( ) -> getAccountIdString ( ) ) continue ; return $ balance ; } return null ; }
Returns an AssetAmount representing the balance of this asset

@param Asset $asset
@return null|AssetAmount
Returns an AssetAmount representing the balance of this asset