Download the PHP package olivierbarbier/zuora-orm without Composer

On this page you can find all versions of the php package olivierbarbier/zuora-orm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zuora-orm

Zuora ORM

StyleCI Build Status Latest Stable Version Total Downloads Latest Unstable Version License Codacy Badge

Introduction

The Zuora ORM provides a simple way for working with Zuora objects without writing ZOQL queries. Each zuora object has a corresponding "Model" which is used to interact with that object.

Basic Usage

Retrieving A Record By Primary Key

$account = Account::find(1);

var_dump($account->Name);

Querying Using Zuora ORM Models

$accounts = Account::where('Status', '=', 'Active')->get();

foreach ($accounts as $account)
{
    var_dump($account->name);
}

Zuora ORM Aggregates

Of course, you may also use the query builder aggregate functions.

$count = Account::where('Status', '=', 100)->get()->count();

Insert, Update, Delete

Using The Model Create Method

// Create a new user in Zuora...
$account = Account::create(array('name' => 'my test account'));

Updating A Retrieved Model

To update a model, you may retrieve it, change an attribute, and use the save method:

$account = Account::find(1);

$account->status = 'Active';

$account->save();

Deleting An Existing Model

To delete a model, simply call the delete method on the instance:

$account = Account::find(1);

$account->delete();

Relationships

One To One

Retrieve A One To One Relation

For example, a Subscription model have one Account.

We may retrieve it using Zuora ORM's dynamic properties:

$account = Subscription::find(1)->account;

The SQL performed by this statement will be as follows:

select * from Subscription where Id = 1

select * from Account where Id = $subscription->Id

One To Many

An example of a one-to-many relation is an account that "has many" subscriptions.

We can access the account's subscriptionss through the dynamic property:

$subscriptions = Account::find(1)->subscriptions;

If you need to add further constraints to which subscriptions are retrieved, you may call the subscriptions method and continue chaining conditions:

$subscriptions = Account::find(1)->subscriptions()->where('Status', '=', 'Active')->get()->first();

Querying Relations

Querying Relations When Selecting

When accessing the records for a model, you may wish to limit your results based on the existence of a relationship. For example, you wish to pull all accounts that have at least one subscription:

$accounts = Account::all()->filter(function($account) { return $account->subscription()->count() > 0; });

Dynamic Properties

Zuora ORM allows you to access your relations via dynamic properties. Zuora ORM will automatically load the relationship for you, and is even smart enough to know whether to call the get (for one-to-many relationships) or first (for one-to-one relationships) method. It will then be accessible via a dynamic property by the same name as the relation.

$subscription = Subscription::find(1);

Instead of echoing the subscription's name like this:

echo $subscription->account()->get()->first()->Name;

It may be shortened to simply:

echo $subscription->account->Name;

Note: Relationships that return many results will return an instance of the Illuminate\Support\Collection class.

Collections

All multi-result sets returned by Zuora ORM, either via the get method or a relationship, will return a collection object. This object implements the IteratorAggregate PHP interface so it can be iterated over like an array. However, this object also has a variety of other helpful methods for working with result sets.

Iterating Collections

Zuora ORM collections also contain a few helpful methods for looping and filtering the items they contain:

Filtering Collections

When filtering collections, the callback provided will be used as callback for array_filter.

$accounts = $accounts->filter(function($account)
{
    return $account->hasSubcriptions();
});

Applying A Callback To Each Collection Object

$subscriptions = Account::find(1)->subscriptions;

$subscriptions->each(function($subscription)
{
    //
});

Sorting A Collection By A Value

$subscriptions = $subscriptions->sortBy(function($subscription)
{
    return $subscription->CreatedDate;
});

All versions of zuora-orm with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ^4.2
olivierbarbier/zuora-soap-api Version v1.0.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package olivierbarbier/zuora-orm contains the following files

Loading the files please wait ....