Download the PHP package cfxmarkets/php-public-models without Composer
On this page you can find all versions of the php package cfxmarkets/php-public-models. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cfxmarkets/php-public-models
More information about cfxmarkets/php-public-models
Files in cfxmarkets/php-public-models
Package php-public-models
Short Description This package provides all of CFX's public data objects.
License MIT
Informations about the package php-public-models
PHP Public Models
This library represents the current set of CFX's public PHP data models. This README will focus on the (very little) general business information surrounding the classes this library provides. For an in-depth discussion of each Resource class's business logic, see the API Docs. (You can view that document more easily by pasting its contents into the editor at http://editor.swagger.io.) For an in-depth discussion of CFX's data model implementation, see php-jsonapi-objects and php-persistence.
Installation
This library can be installed using the standard composer process:
Overview
Currently, there are two primary data domains that CFX operates in: The Brokerage Domain and the Exchange Domain.
The Brokerage Domain encapsulates objects and operations related to the CFX brokerage house. This includes Users, LegalEntities, OrderIntents, Orders, Addresses, BankAccounts, Assets, AssetIntents, DealRooms, TenderRooms, Tenders, and others. In short, any data that concerns a brokerage will be found in the Brokerage Domain.
The Exchange Domain encapsulates objects and operations related to the CFX exchange. This includes Brokerages, Orders, Assets, and Transactions. (Most of these are currently unimplemented at the time of this writing.)
Usage
Most of the important information in this library exists at the class level. That is, what you'll really want to learn about is 1) what classes exist; and 2) how you can use them. You can get this information most easily by simply browsing the classes themselves. However, if you haven't already, you may want to take a minute and familiarize yourself with the style in which this library was meant to be used, detailed in the following paragraphs and examples.
In general, the classes in this library rely on getters and setters to manipulate their data. They also include a few common update and persistence operations, namely updateFromData
, updateFromResource
, save
, initialize
, and refresh
. You can use these methods (and a few others) on all of CFX's public model classes because these are part of the underlying ResourceInterface
on which our resource objects are based.
Thus, following is a common example of how you might end up using these objects. Assume $cfx
is the CFX Brokerage Client from the php-brokerage-sdk
library.
Notice here that the majority of these calls are simple getters and setters. The one call that is not (User::isAtLeast
) is not yet implemented, but is a good example of what sorts of functionality might be introduced by non-setter/getter methods.
Beyond that, there's not too much more to point out. From here, you should study up on the API Docs, as mentioned, and start writing code!
Note About API Documentation
We're hoping to launch a site (developers.cfxtrading.com) soon that will allow us to provide more comprehensive API documentation and other resources for developers. While this site is not live yet, you can still generate good API documentation for this library by cloning the library, installing Sami, and running sami.phar update sami.config.php
.
All versions of php-public-models with dependencies
cfxmarkets/php-jsonapi-objects Version ^1.4.10 | ^2.0.0
cfxmarkets/php-persistence Version ^0.4.3 || ^0.3.3 || ^0.5.0 || ^0.6.0