Download the PHP package ahmedwaleed/soquel without Composer

On this page you can find all versions of the php package ahmedwaleed/soquel. 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 soquel

Salesforce Object Query Language (SOQL) Package For Laravel

Laravel

Laravel SOQL query builder provides a convenient, fluent interface to creating, updating, SOQL queries and fetching records from salesforce.

Requirements

This Package uses omniphx/forrest package as salesforce client to fetch records from salesforce, please refer to package github page for installation and configuration guide.

Installation

You can install the package via composer:

Optionally, you can publish the config file of package.

Set following config with your salesforce credentials.

Update the storage type to Session or Cache, only these storage types are suppored at this time.

Basic Usage

The content of config file will be published at config/soquel.php

ORM Usage

Query Builder is good when you want full control over query, but it becomes cumbersome with a query where you need to select all the fields of an object or want to load child pr parent object rows. This package also provide object-relational-mapper (ORM) support that makes it easy and enjoyable to interact with soql.

Generate Object Classes

To get started, lets create an Object class which by default lives in app/Objects directory and extend the AhmadWaleed\Soquel\Object\BaseObject class, but you can change the default directory in the configuration file. You may use the make:object artisan command to generate a new object class:

The above command will generate following class:

If you would like to generate a custom object class you may use the --type or -t option:

The above command will generate following class:

By default, the Id field of salesforce object will be retrieved, You can also define on the model what fields you want to bring back with each record.

By default, the Id filed is readonly, You can specify which fileds should be excluded while performing insert/update operation on model.

Retrieving Objects

Once you have created an object, you are ready to start retrieving data from salesforce, You can think of each object class as a powerful query builder allowing you to fluently query salesforce object data. The get method will retrieve all (limited to 2000 by salesforce) of the records from the associated object.

Building Queries

Each Object class serves as query builder you add additional constraints to queries and invoke the get method to retrieve the results:

Collections

As we have seen, Object method like get retrieve multiple records from the salesforce. However, these methods don't return a plain PHP array. Instead, an instance of Illuminate\Database\Eloquent\Collection is returned.

The Object class extends Laravel's base Illuminate\Support\Collection class, which provides a variety of helpful methods for interacting with data collections. For example, the reject method may be used to remove objects from a collection based on the results of an invoked closure

Relationships

Salesforce's objects are often related to one another. For example, a Account may have many Contacts, or an Contact could be related to the Account. SOQL ORM makes managing and working with these relationships easy, and supports parent and child relationships:

Defining Relationships

Relationships are defined as methods on your Object classes. Since relationships also serve as powerful query builders, defining relationships as methods provides powerful method chaining and querying capabilities. For example, we may chain additional query constraints on this contacts relationship:

But, before diving too deep into using relationships, let's learn how to define each type of relationship.

Child To Parent

A child-to-parent relationship is a very basic type of salesforce relationship. For example, a Contact object might be associated with one Account object. To define this relationship, we will place a account method on the Contact object. The account method should call the parentRelation method and return its result. The parentRelation method is available to your model via the object AhmadWaleed\Soquel\Object\BaseObject base class:

The first argument passed to the parentRelation method is the name of the related object class. Once the relationship is defined, we may retrieve the related record with following query:

Additionally, you can pass object type and relationship name in second and third argument to parentRelation method;

For custom objects orm assumes relationship name, For example for custom object Jobc the relationship name will be Jobr, But if you want to override the default convention you can pass relationship name as third argument.

Parent To Child

A parent-to-child relationship is used to define relationships where a single object is the parent to one or more child objects. For example, a account may have an infinite number of contacts. Like all other Salesforce relationships, parent-to-child relationships are defined by defining a method on your Object class:

The first argument passed to the childRelation method is the name of the related object class. Once the relationship is defined, we may retrieve the related records with following query:

Additionally, you can pass object type and relationship name in second and third argument to childRelation method;

For custom objects orm assumes relationship name, For example for custom object Attachmentc the relationship name will be Attachmentr, But if you want to override the default convention you can pass relationship name as third argument.

Inserting and Updating

License

The MIT License (MIT). Please see License File for more information.


All versions of soquel with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
omniphx/forrest Version ^2.11
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 ahmedwaleed/soquel contains the following files

Loading the files please wait ....