Overview

Namespaces

  • PipelinerSales
    • ApiClient
      • Http
      • Query
      • Repository
        • Rest

Interfaces

  • RepositoryFactoryInterface
  • RepositoryInterface
  • Overview
  • Namespace
  • Class
  • Tree

Interface RepositoryInterface

An interface for retrieving and manipulating entities.

Direct known implementers

PipelinerSales\ApiClient\Repository\Rest\RestRepository
Namespace: PipelinerSales\ApiClient\Repository
Located at PipelinerSales/ApiClient/Repository/RepositoryInterface.php
Methods summary
public PipelinerSales\ApiClient\Entity
# create( )

Creates a new entity. Please note that this entity won't exist on the server until you save it by calling the save method.

Creates a new entity. Please note that this entity won't exist on the server until you save it by calling the save method.

Returns

PipelinerSales\ApiClient\Entity
public PipelinerSales\ApiClient\Http\Response
# delete( mixed $entity, integer $flags = PipelinerSales\ApiClient\Repository\RepositoryInterface::FLAG_ROLLBACK_ON_ERROR )

Deletes an entity

Deletes an entity

Parameters

$entity
the entity to delete, or an array of multiple entities
$flags

used only if multiple entities are provided, flags described on http://workspace.pipelinersales.com/community/api/data/Methods_rest.html

Returns

PipelinerSales\ApiClient\Http\Response
response to the delete HTTP request

Throws

PipelinerSales\ApiClient\Http\PipelinerHttpException
PipelinerSales\ApiClient\PipelinerClientException

when the entity provided doesn't have an ID, which usually means that it's a newly created entity that wasn't saved yet

public PipelinerSales\ApiClient\Http\Response
# deleteById( mixed $id, integer $flags = 0 )

Deletes one or more entities specified by their ID

Deletes one or more entities specified by their ID

Parameters

$id
the ID of the entity to delete, or an array containing multiple IDs
$flags

used only if multiple IDs are provided, flags described on http://workspace.pipelinersales.com/community/api/data/Querying_rest.html

Returns

PipelinerSales\ApiClient\Http\Response
response to the delete HTTP request

Throws

PipelinerSales\ApiClient\Http\PipelinerHttpException
public PipelinerSales\ApiClient\EntityCollection
# get( mixed $criteria = null )

Returns a collection of all entities satisfying the provided criteria

Returns a collection of all entities satisfying the provided criteria

Parameters

$criteria

Can be one of the following

  • null - fetches all entities up to a default limit of 25
  • a Criteria object
  • a Filter object
  • a Sort object
  • a query string following the format described at http://workspace.pipelinersales.com/community/api/data/Querying_rest.html
  • an array with keys corresponding to the format at http://workspace.pipelinersales.com/community/api/data/Querying_rest.html

Returns

PipelinerSales\ApiClient\EntityCollection

Throws

PipelinerSales\ApiClient\Http\PipelinerHttpException
when retrieving data from the server fails
PipelinerSales\ApiClient\PipelinerClientException
when provided criteria is invalid
public PipelinerSales\ApiClient\Entity
# getById( string $id )

Returns an entity with the specified ID

Returns an entity with the specified ID

Parameters

$id

Returns

PipelinerSales\ApiClient\Entity

Throws

PipelinerSales\ApiClient\Http\PipelinerHttpException
public PipelinerSales\ApiClient\Http\Response|PipelinerSales\ApiClient\Http\CreatedResponse
# save( mixed $entity, integer $sendFields = PipelinerSales\ApiClient\Repository\RepositoryInterface::SEND_MODIFIED_FIELDS )

Uploads an entity to the server.

Uploads an entity to the server.

Parameters

$entity
the entity to upload, an PipelinerSales\ApiClient\Entity object or an associative array
$sendFields

whether to upload all the fields for Entity objects, or just the fields which have been modified in code since the entity was loaded/saved

Returns

PipelinerSales\ApiClient\Http\Response|PipelinerSales\ApiClient\Http\CreatedResponse
response to the HTTP request

Throws

PipelinerSales\ApiClient\Http\PipelinerHttpException
public PipelinerSales\ApiClient\Http\Response
# bulkUpdate( mixed $data, integer $flags = PipelinerSales\ApiClient\Repository\RepositoryInterface::FLAG_ROLLBACK_ON_ERROR, integer $sendFields = PipelinerSales\ApiClient\Repository\RepositoryInterface::SEND_MODIFIED_FIELDS )

Updates multiple entities at once

Updates multiple entities at once

Parameters

$data

entities to update, where each entity is either an entity object or an associative array with keys corresponding to fields and values to the entity's values. See the setEntities method at http://workspace.pipelinersales.com/community/api/data/Methods_rest.html

$flags

flags described on http://workspace.pipelinersales.com/community/api/data/Methods_rest.html

$sendFields

whether to upload all the fields for Entity objects, or just the fields which have been modified in code since the entity was loaded/saved

Returns

PipelinerSales\ApiClient\Http\Response
response to the HTTP request

Throws

PipelinerSales\ApiClient\Http\PipelinerHttpException
public PipelinerSales\ApiClient\EntityCollectionIterator
# getEntireRangeIterator( PipelinerSales\ApiClient\EntityCollection $collection )

Returns an iterator set to the offset of the query's criteria

Returns an iterator set to the offset of the query's criteria

Parameters

$collection

Returns

PipelinerSales\ApiClient\EntityCollectionIterator
Constants summary
integer FLAG_ROLLBACK_ON_ERROR

If any error occurs, no entity will be processed, and the entire batch will be rolled back.

If any error occurs, no entity will be processed, and the entire batch will be rolled back.

# 0
integer FLAG_IGNORE_ON_ERROR

If an error occurs for an entity, the entity is ignored and the system continues with the next one.

If an error occurs for an entity, the entity is ignored and the system continues with the next one.

# 1
integer FLAG_INSERT_ON_UPDATE

If any error occurs during the update of an entity (e.g. the entity doesn’t exists), the entity will be inserted instead, and a new unique identificator will be generated

If any error occurs during the update of an entity (e.g. the entity doesn’t exists), the entity will be inserted instead, and a new unique identificator will be generated

# 2
integer FLAG_GET_NO_DELETED_ID

The method will return a list of IDs which cannot be deleted. Can be used with combination with FLAG_IGNORE_ON_ERROR.

The method will return a list of IDs which cannot be deleted. Can be used with combination with FLAG_IGNORE_ON_ERROR.

# 4
integer FLAG_IGNORE_AND_RETURN_ERRORS

If any error occurs for an entity, the entity is ignored and the system continues with the next one.

If any error occurs for an entity, the entity is ignored and the system continues with the next one.

# 8
integer FLAG_VALIDATE_ONLY_UPDATED_FIELDS

Only updated fields in the entity will be validated instead of all fields.

Only updated fields in the entity will be validated instead of all fields.

# 256
integer SEND_MODIFIED_FIELDS

Partial update, send only fields which have been modified since the entity was last loaded/saved

Partial update, send only fields which have been modified since the entity was last loaded/saved

# 0
integer SEND_ALL_FIELDS

Send all fields that exist within the entity

Send all fields that exist within the entity

# 1
API documentation generated by ApiGen