Documentation

BexioInvoice extends BexioAPI
in package
Uses tBexioV2Api, tBexioObject, tBexioPDFObject, tBexioProjectObject, tBexioCollection, tBexioNumberObject

Represent the enpoint Invoices

Tags
link
https://docs.bexio.com/#tag/Invoices

Table of Contents

Constants

type  = 'kb_invoice'

Properties

$className  : string
$ctx  : BexioCTX
$endpoint  : string
$ownerid  : int|null
$query  : string
$userid  : int|null

Methods

__construct()  : mixed
Create withing the given context.
delete()  : bool
Delete an item in the collection.
get()  : BXObject
Get an item from the collection
getByNumber()  : BXObject
getIdName()  : string
Return the property name used as unique id for this collection.
getPDF()  : BXObject
getType()  : string
Get the current type.
list()  : array<string|int, BXObject>
List the collection.
listByProject()  : array<string|int, mixed>
new()  : BXObject
Create a new BXObject.
newQuery()  : BXquery
Create a new BXQuery object for this collection.
search()  : array<string|int, BXObject>
Search the collection.
set()  : BXObject|false
Set an item in the collection
setCurrentOwner()  : void
Set current owner id.
setCurrentUser()  : void
Set current user id.
update()  : BXObject|false
[!!!] Update an item in the collection

Constants

type

public mixed type = 'kb_invoice'

Properties

$className

protected string $className = 'BizCuit\\BXObject\\Invoice'

$endpoint

protected string $endpoint

$ownerid

protected int|null $ownerid = null

$query

protected string $query = 'BizCuit\\BXQuery\\Invoice'

$userid

protected int|null $userid = null

Methods

__construct()

Create withing the given context.

public __construct(BexioCTX $ctx) : mixed
Parameters
$ctx : BexioCTX

The context in which the API will work.

delete()

Delete an item in the collection.

public delete(int|string|BXObject $id) : bool
APIYes
Parameters
$id : int|string|BXObject

The id or the object to delete.

Return values
bool

True on success, false otherwise.

get()

Get an item from the collection

public get(int|string|BXObject $id[, array<string|int, mixed> $options = [] ]) : BXObject
APIYes
Parameters
$id : int|string|BXObject

The id or the object to get.

$options : array<string|int, mixed> = []

Options that can be passed as query string.

Return values
BXObject

The item as a BXObject.

getByNumber()

public getByNumber(int|string $id) : BXObject
Parameters
$id : int|string
Return values
BXObject

getIdName()

Return the property name used as unique id for this collection.

public getIdName() : string
APIYes
Return values
string

ID name.

getType()

Get the current type.

public getType() : string

The current type correspond to an endpoint in the upstream API.

Return values
string

The type name

list()

List the collection.

public list([int $offset = 0 ][, int $limit = 500 ]) : array<string|int, BXObject>
APIYes
Parameters
$offset : int = 0

Offset in the search result,

$limit : int = 500

Max number of search result.

Return values
array<string|int, BXObject>

Items in the collection.

listByProject()

public listByProject(int|BXObject $projectId) : array<string|int, mixed>
Parameters
$projectId : int|BXObject
Return values
array<string|int, mixed>

newQuery()

Create a new BXQuery object for this collection.

public newQuery() : BXquery
APIYes
Return values
BXquery

The BXQuery valid for this collection.

Search the collection.

public search(BXQuery $query[, int $offset = 0 ][, int $limit = 500 ]) : array<string|int, BXObject>
APIYes
Parameters
$query : BXQuery

The query object.

$offset : int = 0

Offset in the search result,

$limit : int = 500

Max number of search resutl.

Return values
array<string|int, BXObject>

Matching items in the collection.

set()

Set an item in the collection

public set(BXObject $content) : BXObject|false
APIYes

Setting an item would create the item if it don't have an ID or overwrite the item if it has an ID.

Parameters
$content : BXObject

The object to be set.

Return values
BXObject|false

The item is returned as stored in collection or false in case of error

setCurrentOwner()

Set current owner id.

public setCurrentOwner(int $ownerid) : void

Some items, at creation, need a user id and/or an owner id. This set the owner.

Parameters
$ownerid : int

The id of the owner for all creation from now on.

setCurrentUser()

Set current user id.

public setCurrentUser(int $userid) : void

Some items, at creation, need a user id and/or an owner id. Setting this here allows to automatically add this to the item. If only user is set, when owner is needed it would be set to user.

Parameters
$userid : int

The id of the user for all creation from now on.

update()

[!!!] Update an item in the collection

public update(BXObject $content) : BXObject|false
APIYes

This should update property of an item. But the upstream API is buggy here, so no way to know what UPDATE does.

Parameters
$content : BXObject

The object to be set.

Return values
BXObject|false

The item is returned as stored in collection or false in case of error


        
On this page

Search results