Documentation

Addressbook extends Client
in package

Address handler.

Tags
author

vitex

Table of Contents

$agenda  : string|null
Current Object's agenda.
$compress  : bool
Enable Curl Compress ?
$curlInfo  : mixed
Informace o posledním HTTP requestu.
$defaultHttpHeaders  : array<string|int, mixed>
$errors  : array<string|int, mixed>
Array of errors.
$lastCurlError  : string|null
Informace o poslední HTTP chybě.
$lastCurlResponse  : string
Raw Content of last curl response.
$lastResponseCode  : int|null
HTTP Response code of last request.
$lastResponseMessage  : string|null
Meaning of HTTP Response code of last request.
$nameColumn  : string|null
AddressBook records name column.
$offline  : bool
We Connect to server by default.
$password  : string|null
REST API Password.
$postFields  : string|null
Body data for next curl POST operation.
$requestXml  : Agenda|null
Request XML helper.
$response  : Response|null
$responseStats  : array<string|int, mixed>
Response stats live here.
$timeout  : int|null
Override cURL timeout.
$url  : string|null
[protocol://]Server[:port].
$user  : string|null
REST API Username.
$xmlCache  : string|null
Path to teporary XML file.
$ico  : string|null
My Company identification ID.
$pohoda  : Pohoda
XML Response Processor.
$curl  : CurlHandle
__construct()  : mixed
mServer client class.
__wakeup()  : void
Reconnect After unserialization.
addToPohoda()  : int
Insert prepared record to Pohoda.
commit()  : bool
create()  : int
Create Agenda document using given data.
curlInit()  : bool
Inicializace CURL.
doCurlRequest()  : int
Perform HTTP request.
filterToMe()  : array<string, string>
Filter to select only "current" record.
getColumnsFromPohoda()  : array<string|int, mixed>|null
Obtain given fields from Pohoda.
isOnline()  : bool
Check mServer availability.
libVersion()  : string
Application version or "0.0.0" fallback.
loadFromPohoda()  : mixed
Load data from Pohoda.
logBanner()  : void
Add Info about used user, server and libraries.
performRequest()  : bool
A function that performs an I/O operation and evaluates the result.
processInit()  : void
Process and use initial value.
processResponse()  : bool
Response processing handler.
reset()  : void
Prepare XML processing engine.
sendRequest()  : string
setAgenda()  : void
setApplication()  : void
Set Application http header.
setAuth()  : bool
Set Authentication.
setCheckDuplicity()  : void
Set "Check Duplicity" http header enabler.
setInstance()  : void
Set Instance http header.
setObjectName()  : mixed
{@inheritDoc}
setPostFields()  : void
Prepare data to send.
setUp()  : void
SetUp Object to be ready for work.
takeData()  : int
Use data in object.
updateInPohoda()  : bool
Insert prepared record to Pohoda.

Properties

$agenda

Current Object's agenda.

public string|null $agenda = 'addressBook'

$compress

Enable Curl Compress ?

public bool $compress = true

$curlInfo

Informace o posledním HTTP requestu.

public mixed $curlInfo

$defaultHttpHeaders

public array<string|int, mixed> $defaultHttpHeaders = ['STW-Application' => 'PHPmServer', 'Accept' => 'application/xml', 'Content-Type' => 'application/xml']

of Http headers attached with every request

$errors

Array of errors.

public array<string|int, mixed> $errors = []

$lastCurlError

Informace o poslední HTTP chybě.

public string|null $lastCurlError = null

$lastCurlResponse

Raw Content of last curl response.

public string $lastCurlResponse

$lastResponseCode

HTTP Response code of last request.

public int|null $lastResponseCode = null

$lastResponseMessage

Meaning of HTTP Response code of last request.

public string|null $lastResponseMessage = null

$nameColumn

AddressBook records name column.

public string|null $nameColumn = 'address:company'

column name or path in array address:company

$offline

We Connect to server by default.

public bool $offline = false

$password

REST API Password.

public string|null $password = null

$postFields

Body data for next curl POST operation.

public string|null $postFields = null

$requestXml

Request XML helper.

public Agenda|null $requestXml = null

$responseStats

Response stats live here.

public array<string|int, mixed> $responseStats = []

$timeout

Override cURL timeout.

public int|null $timeout = null

seconds

$url

[protocol://]Server[:port].

public string|null $url = null

$user

REST API Username.

public string|null $user = null

$xmlCache

Path to teporary XML file.

public string|null $xmlCache = null

$ico

My Company identification ID.

protected string|null $ico = null

$pohoda

XML Response Processor.

protected Pohoda $pohoda

Methods

__construct()

mServer client class.

public __construct([mixed $init = null ][, array<string, string> $options = [] ]) : mixed
Parameters
$init : mixed = null

default record id or initial data. See processInit()

$options : array<string, string> = []

Connection settings and other options override

Return values
mixed

__wakeup()

Reconnect After unserialization.

public __wakeup() : void
Return values
void

addToPohoda()

Insert prepared record to Pohoda.

public addToPohoda([array<string, string> $data = [] ]) : int
Parameters
$data : array<string, string> = []

extra data

Return values
int

commit()

public commit() : bool
Return values
bool

create()

Create Agenda document using given data.

public create(array<string, array|string> $data) : int
Parameters
$data : array<string, array|string>
Return values
int

curlInit()

Inicializace CURL.

public curlInit() : bool
Return values
bool

Online Status

doCurlRequest()

Perform HTTP request.

public doCurlRequest(string $url, string $method[, null|mixed $format = null ]) : int
Parameters
$url : string

Request URL

$method : string

HTTP Method GET|POST

$format : null|mixed = null
Return values
int

HTTP Response CODE

filterToMe()

Filter to select only "current" record.

public filterToMe() : array<string, string>
Return values
array<string, string>

getColumnsFromPohoda()

Obtain given fields from Pohoda.

public getColumnsFromPohoda([array<string|int, mixed> $columns = ['id'] ][, mixed $conditions = [] ]) : array<string|int, mixed>|null
Parameters
$columns : array<string|int, mixed> = ['id']
$conditions : mixed = []
Return values
array<string|int, mixed>|null

isOnline()

Check mServer availability.

public isOnline() : bool
Return values
bool

libVersion()

Application version or "0.0.0" fallback.

public static libVersion() : string
Return values
string

loadFromPohoda()

Load data from Pohoda.

public loadFromPohoda([null|mixed $phid = null ]) : mixed
Parameters
$phid : null|mixed = null
Return values
mixed

logBanner()

Add Info about used user, server and libraries.

public logBanner([string $prefix = null ][, string $suffix = null ]) : void
Parameters
$prefix : string = null

banner prefix text

$suffix : string = null

banner suffix text

Return values
void

performRequest()

A function that performs an I/O operation and evaluates the result.

public performRequest([string $urlSuffix = '' ][, string $method = 'POST' ]) : bool
Parameters
$urlSuffix : string = ''

part of the URL after the company identifier

$method : string = 'POST'

HTTP/REST metoda

Return values
bool

request commit status

processInit()

Process and use initial value.

public processInit(mixed $init) : void
Parameters
$init : mixed
Return values
void

processResponse()

Response processing handler.

public processResponse(int $httpCode) : bool
Parameters
$httpCode : int
Return values
bool

reset()

Prepare XML processing engine.

public reset() : void
Return values
void

sendRequest()

public sendRequest(string $request) : string
Parameters
$request : string
Return values
string

setAgenda()

public setAgenda(string $agenda) : void
Parameters
$agenda : string
Return values
void

setApplication()

Set Application http header.

public setApplication(string $application) : void
Parameters
$application : string
Return values
void

setAuth()

Set Authentication.

public setAuth() : bool
Return values
bool

setCheckDuplicity()

Set "Check Duplicity" http header enabler.

public setCheckDuplicity(bool $flag) : void
Parameters
$flag : bool
Return values
void

setInstance()

Set Instance http header.

public setInstance(string $instance) : void
Parameters
$instance : string
Return values
void

setObjectName()

{@inheritDoc}

public setObjectName([mixed $forceName = '' ]) : mixed
Parameters
$forceName : mixed = ''
Return values
mixed

setPostFields()

Prepare data to send.

public setPostFields(string $data) : void
Parameters
$data : string
Return values
void

setUp()

SetUp Object to be ready for work.

public setUp([array<string, string> $options = [] ]) : void
Parameters
$options : array<string, string> = []

Object Options ( user,password,authSessionId company,url,agenda, debug, filter,ignore404 timeout,companyUrl,ver,throwException

Return values
void

takeData()

Use data in object.

public takeData(array<string, string> $data) : int
Parameters
$data : array<string, string>

raw document data

Return values
int

updateInPohoda()

Insert prepared record to Pohoda.

public updateInPohoda([array<string, string> $data = [] ][, null|mixed $filter = null ]) : bool
Parameters
$data : array<string, string> = []

extra data

$filter : null|mixed = null
Return values
bool

Search results