Example #1
0
     * Gets Bf_Invoices for a given Bf_Subscription version
     * @param string version ID of the Bf_Subscription
     * @return Bf_Invoice[]
     */
    public static function getForSubscriptionVersion($subscriptionVersionID, $options = NULL, $customClient = NULL)
    {
        // empty IDs are no good!
        if (!$subscriptionVersionID) {
            throw new Bf_EmptyArgumentException("Cannot lookup empty ID!");
        }
        $endpoint = sprintf("subscription/version/%s", rawurlencode($subscriptionVersionID));
        return static::getCollection($endpoint, $options, $customClient);
    }
    /**
     * Gets Bf_Invoices for a given Bf_Account
     * @param union[string | Bf_Account] $account Reference to account <string>: $id of the Bf_Account. <Bf_Account>: The Bf_Account entity.
     * @return Bf_Invoice[]
     */
    public static function getForAccount($account, $options = NULL, $customClient = NULL)
    {
        $accountID = Bf_Account::getIdentifier($account);
        $endpoint = sprintf("account/%s", rawurlencode($accountID));
        return static::getCollection($endpoint, $options, $customClient);
    }
    public static function initStatics()
    {
        self::$_resourcePath = new Bf_ResourcePath('invoices', 'invoice');
    }
}
Bf_Invoice::initStatics();