Download the PHP package meiosis-io/amino without Composer

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

Petri API - PHP SDK

This package will handle integration with the Petri API Services

Installation

Common Concepts

The Meiosis\Amino class methods will all return instances that extend Meiosis\CRMObject. These objects interact with their respective API endpoints, and should return items that extend Meiosis\Models\BaseModel. For example, to fetch a list of Pages out of the content management system that have a name that contains the text "Press Release", our code might look like this:

In this case, $pages is now an array whose items are instances of the Meiosis\Models\Page object. Any attributes on these objects are directly available:

CRMObject Methods

The following methods are available on any object that extends the Meiosis\Endpoints\CRMObject class, such as the objects returned by the methods on the Meiosis\Amino class.

->find($identifier)

Given an identifier, the find method will return exactly one object that extends Meiosis\Models\BaseModel

->search($searchArray)

Given an array of search parameters in the format ['key' => 'value'], the search method will return an array of objects that extend Meiosis\Models\BaseModel

->blueprint()

The blueprint method will return a new instance of the appropriate implementation of Meiosis\Models\BaseModel. For example, a new empty customer would look like:

->save($object)

Passing the save method an implementation of the corresponding Meiosis\Models\BaseModel will create a new object if it does not yet exist, or will update an existing object. A shortcut to this method exists on each BaseModel object, via it's own internal ->save() method. For example, the following two blocks achieve the same thing:

->delete($identifier)

Given an identifier, deletes the record from the system.

->payload($data)

Build the payload needed for the APIClient. This method is mostly used internally, but is publicly available.

BaseModel Methods

The following methods are available on any object that extends the Meiosis\Models\BaseModel class, such as the objects returned by the classes in Meiosis\Endpoints

::getNativeFields()

The static getNativeFields() method will return the $native array on each BaseModel. This is used when building new methods, or when you want to combine native attributes with custom attributes.

->populate($data)

Populates the object instance with data from the $data array.

->extract()

Converts the object into an array, extracting the underlying $data array

->save()

Creates or updates the object and repopulated it with any new fields (id, timestamps, etc)

->refresh()

Reloads the object, fetching fresh data from the api

Common Exceptions

Initalization

You'll need to initialize a new instance of the Amino class, giving it an API token and Team ID

If you want to ensure that your server is able to reach the api properly, you can call the remote test function:

Customers

To work with customers, call the customers() method on the Amino class. Models returned are instances of the Meiosis\Models\Customer class.

Additional Methods

Aside from the methos mentioned on CRMObject Methods, the following methods also exist:

->trackInteraction($customer, $source, $description, $priority)

Given a Meiosis\Models\Customer object ($customer), this method will record an interaction from the source $source, with the description $description, with a default $priority of 5.

Organizations

To work with orgnaizations, call the organizations() method on the Amino class. Models returned are instances of the Meiosis\Models\Organization class.

Transactions

To work with transactions, call the transactions() method on the Amino class. Models returned are instances of the Meiosis\Models\Transaction class.

Special Cases

->search($searchArray)

Transactions are not searchable. This method will throw a Meiosis\Exceptions\InvalidEndpointException Exception.

->save()

While new transactions can be saved, existing transactions can not. Transactions can not be updated once recorded, but can be voided.

Content Management - Sites

To work with sites, call the sites() method on the Amino class. Models returned are instances of the Meiosis\Models\Site class.

Content Management - Pages

To work with pages, call the pages() method on the Amino class, passing in a site token / ID. Models returned are instances of the Meiosis\Models\Page class.

Additional Methods

Aside from the methos mentioned on CRMObject Methods, the following methods also exist:

->getHierarchy($pageID)

The getHierarchy method accepts an optional $pageID parameter. Without a $pageID, it will return an array of simple Meiosis\Models\Page objects, with their children, starting at the root level of the page hierarchy. If passing a $pageID, the returned array will have the matching page as the only root page.

->bySlug($slug)

Given a $slug, the bySlug method will return an array of pages that match the given slug. The slug should be as specific as possible, including parents as well. For example, a page with the slug my-page that is a child of a about-us page could be found with: ->bySlug('about-us/my-page');

->setSiteToken($token)

The setSiteToken method can be used to change which site the class is using.

Content Management - Page Types

To work with Page Types, call the pageTypes() method on the Amino class, passing in a site token / ID. Models returned are instances of the Meiosis\Models\PageType class.

Additional Methods

Aside from the methos mentioned on CRMObject Methods, the following methods also exist:

->setSiteToken($token)

The setSiteToken method can be used to change which site the class is using.

Content Management - Page Attributes

To work with Page Attributes, call the pageAttributes() method on the Amino class, passing in a page type ID. Models returned are instances of the Meiosis\Models\PageAttribute class.

Additional Methods

Aside from the methos mentioned on CRMObject Methods, the following methods also exist:

->all()

Returns an array of all PageAttributes for the page type.

Practical Examples

Create a new Customer and track an interaction

Record a transaction

Get pages based on custom attributes

Assuming that a custom page attribute has been created with the key attr_category, we will find all pages in the category 'news':


All versions of amino with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4.0
guzzlehttp/guzzle Version >=6.2
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 meiosis-io/amino contains the following files

Loading the files please wait ....