PHP Classes

PHP MoySklad Client: Access the MoySklad API using ORM like objects

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 124 All time: 9,456 This week: 524Up
Version License PHP version Categories
moysklad-client 0.1MIT/X Consortium ...5.4PHP 5, E-Commerce, Web services
Description 

Author

This package is specific mainly for applications used in Russian Federation Russian Federation .

This package can access the MoySklad API using ORM like objects.

It provides a set of classes that send HTTP requests to the MoySklad API and perform several types of operations with all types of entities like some ORM libraries perform.

It can find or load objects, set and get the object properties, save or delete objects, etc..

The package comes with MoySklad entity objects for companies, customers, orders, payments, stock items, etc..

Picture of Oleksii Mylotskyi
  Performance   Level  
Name: Oleksii Mylotskyi is available for providing paid consulting. Contact Oleksii Mylotskyi .
Classes: 2 packages by
Country: Ukraine Ukraine
Age: 37
All time rank: 326852 in Ukraine Ukraine
Week rank: 214 Up2 in Ukraine Ukraine Up
Innovation award
Innovation award
Nominee: 1x

Example

<?php
namespace Zf2ClientMoysklad;

require_once
__DIR__.'/_config.php';

use
Zf2ClientMoysklad\Entity\Good;
use
Zf2ClientMoysklad\Entity\PurchaseOrder;
use
Zf2ClientMoysklad\Repository\BasicRepository;

global
$sm;

/* @var $entityManager EntityManager */
$entityManager = $sm->get('zf2clientmoysklad_entity_manager');

/*====================== Method for Create purchase orders ==========================*/

$entityToOrder = '1e474a24-5cd7-11e3-00e2-7054d21a8d1e';

/* @var $goodEntity Good */
$goodEntity = $entityManager->find('Zf2ClientMoysklad\Entity\Good', $entityToOrder);

$purchaseOrder = new PurchaseOrder();
$purchaseOrderPosition = new PurchaseOrder\Position();

$entityManager->persist($purchaseOrder);

//Dealer id
$purchaseOrder->setSourceAgentUuid('2678f502-5cc9-11e3-320b-7054d21a8d1e');

//Your organisation id
$purchaseOrder->setTargetAgentUuid('266ce37b-5cc9-11e3-92f6-7054d21a8d1e');

$purchaseOrderPosition->setGoodsUuid($goodEntity->getUuid());
$purchaseOrderPosition->setPriceSum($goodEntity->getPrice());
$purchaseOrderPosition->setPriceSumInCurrency($goodEntity->getPrice());
$purchaseOrderPosition->setQuantity(1000);
$purchaseOrderPosition->setReserve(10);

$purchaseOrder->addOrderPosition($purchaseOrderPosition);

$purchaseOrderPosition = new PurchaseOrder\Position();
$purchaseOrderPosition->setGoodsUuid($goodEntity->getUuid());
$purchaseOrderPosition->setPriceSum($goodEntity->getPrice());
$purchaseOrderPosition->setPriceSumInCurrency($goodEntity->getPrice());
$purchaseOrderPosition->setQuantity(10);
$purchaseOrderPosition->setReserve(1);

$purchaseOrder->addOrderPosition($purchaseOrderPosition);

$entityManager->flush();

/*---------------------------------------------------------------------------------*/


Details

Client for http://www.moysklad.ru/

To setup library you have to had composer.phar. You can download it using this command:

php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"

or you can follow the instructions on http://getcomposer.org/download/

Composer will install all required Zend libraries.

After the composer has been downloaded, you should run it:

chmod a+x composer.phar && ./composer.phar install

or

./composer.phar update

Simple usage examples you can found in demo/ folder.

If your project already includes Zend Framework 2, this module could be installed as Zend Framework 2 module. You should only copy config/zf2clientmoysklad.global.php to your config/autoload and change commented line with your connection credentials.


  Files folder image Files (65)  
File Role Description
Files folder imageconfig (1 file)
Files folder imagedemo (5 files)
Files folder imagesrc (1 directory)
Accessible without login Plain text file .gitignore Data Auxiliary data
Accessible without login Plain text file composer.json Data composer.json
Accessible without login Plain text file LICENSE Lic. LICENSE
Plain text file Module.php Class Module.php
Accessible without login Plain text file README.md Data README.md

  Files folder image Files (65)  /  config  
File Role Description
  Accessible without login Plain text file zf2clientmoysklad.global.php.dist Conf. Config

  Files folder image Files (65)  /  demo  
File Role Description
  Accessible without login Plain text file ChangeCustomerOrders.php Example Demo Files
  Accessible without login Plain text file CreatePurchaseOrders.php Example Demo Files
  Accessible without login Plain text file SendingPayments.php Example Demo Files
  Accessible without login Plain text file UpdateOneGoods.php Example Demo Files
  Accessible without login Plain text file _config.php Conf. Demo Config

  Files folder image Files (65)  /  src  
File Role Description
Files folder imageZf2ClientMoysklad (2 files, 12 directories)

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  
File Role Description
Files folder imageCode (1 directory)
Files folder imageEntity (10 files, 5 directories)
Files folder imageException (3 files)
Files folder imageHydrator (1 file, 1 directory)
Files folder imageMapper (2 files)
Files folder imageMetadata (3 files, 2 directories)
Files folder imageOptions (2 files, 1 directory)
Files folder imagePersister (2 files, 1 directory)
Files folder imageRepository (3 files)
Files folder imageService (1 directory)
Files folder imageTransport (2 files)
Files folder imageXml (1 file)
  Plain text file EntityManager.php Class Core Files
  Plain text file UnitOfWork.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Code  
File Role Description
Files folder imageAnnotation (7 files, 2 directories)

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Code  /  Annotation  
File Role Description
Files folder imageException (1 file)
Files folder imageParser (1 file)
  Plain text file Column.php Class Core Files
  Plain text file Criteria.php Class Core Files
  Plain text file Entity.php Class Core Files
  Plain text file Id.php Class Core Files
  Plain text file OneToMany.php Class Core Files
  Plain text file Service.php Class Core Files
  Plain text file XML.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Code  /  Annotation  /  Exception  
File Role Description
  Plain text file InvalidAttributeValueException.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Code  /  Annotation  /  Parser  
File Role Description
  Plain text file AnnotationParser.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Entity  
File Role Description
Files folder imageCustomerOrder (1 file)
Files folder imageEnter (1 file)
Files folder imageGood (1 file)
Files folder imagePurchaseOrder (1 file)
Files folder imageSupply (1 file)
  Plain text file Company.php Class Core Files
  Plain text file CustomerOrder.php Class Core Files
  Plain text file Enter.php Class Core Files
  Plain text file EntityInterface.php Class Core Files
  Plain text file Good.php Class Core Files
  Plain text file GoodFolder.php Class Core Files
  Plain text file PaymentIn.php Class Core Files
  Plain text file PurchaseOrder.php Class Core Files
  Plain text file StockItem.php Class Core Files
  Plain text file Supply.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Entity  /  CustomerOrder  
File Role Description
  Plain text file Position.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Entity  /  Enter  
File Role Description
  Plain text file EnterPosition.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Entity  /  Good  
File Role Description
  Plain text file Price.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Entity  /  PurchaseOrder  
File Role Description
  Plain text file Position.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Entity  /  Supply  
File Role Description
  Plain text file ShipmentIn.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Exception  
File Role Description
  Plain text file ExceptionInterface.php Class Core Files
  Plain text file InvalidArgumentException.php Class Core Files
  Plain text file RuntimeException.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Hydrator  
File Role Description
Files folder imageException (1 file)
  Plain text file EntityHydrator.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Hydrator  /  Exception  
File Role Description
  Plain text file RuntimeException.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Mapper  
File Role Description
  Plain text file GenericMapper.php Class Core Files
  Plain text file MapperInterface.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Metadata  
File Role Description
Files folder imageCollector (2 files, 1 directory)
Files folder imageException (1 file)
  Plain text file ClassMetadata.php Class Core Files
  Plain text file MetadataCollection.php Class Core Files
  Plain text file PropertyMetadata.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Metadata  /  Collector  
File Role Description
Files folder imageException (1 file)
  Plain text file CollectorInterface.php Class Core Files
  Plain text file EntityCollector.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Metadata  /  Collector  /  Exception  
File Role Description
  Plain text file RuntimeException.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Metadata  /  Exception  
File Role Description
  Plain text file InvalidArgumentException.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Options  
File Role Description
Files folder imageException (1 file)
  Plain text file ModuleOptions.php Class Core Files
  Plain text file ModuleOptionsInterface.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Options  /  Exception  
File Role Description
  Plain text file InvalidArgumentException.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Persister  
File Role Description
Files folder imageException (1 file)
  Plain text file BasicEntityPersister.php Class Core Files
  Plain text file PersisterInterface.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Persister  /  Exception  
File Role Description
  Plain text file InvalidArgumentException.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Repository  
File Role Description
  Plain text file BasicRepository.php Class Core Files
  Plain text file RepositoryAbstract.php Class Core Files
  Plain text file StockItemsRepository.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Service  
File Role Description
Files folder imageException (2 files)

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Service  /  Exception  
File Role Description
  Plain text file DomainException.php Class Core Files
  Plain text file RuntimeException.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Transport  
File Role Description
  Plain text file GenericTransport.php Class Core Files
  Plain text file TransportInterface.php Class Core Files

  Files folder image Files (65)  /  src  /  Zf2ClientMoysklad  /  Xml  
File Role Description
  Plain text file SimpleXmlElement.php Class Core Files

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:124
This week:0
All time:9,456
This week:524Up