BexioExpense
extends BexioAPI
in package
Uses
tBexioV4Api, tBexioObject
Represent the enpoint Expenses [read only]
Tags
Table of Contents
Constants
- type = 'currencies'
Properties
- $className : string
- $ctx : BexioCTX
- $endpoint : string
- $ownerid : int|null
- $query : string
- $search_fields : mixed
- $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
- getIdName() : string
- Get ID name for version 4 of the API.
- getType() : string
- Get the current type.
- list() : array<string|int, mixed>
- List request for version 4 of the API.
- new() : BXObject
- Create a new BXObject.
- newQuery() : BXQuery
- Create new query for version 4 of the API.
- search() : array<string|int, mixed>
- Search request for version 4 of the API.
- 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
= 'currencies'
Properties
$className
protected
string
$className
= 'BizCuit\\BXObject\\Expense'
$ctx
protected
BexioCTX
$ctx
$endpoint
protected
string
$endpoint
$ownerid
protected
int|null
$ownerid
= null
$query
protected
string
$query
= 'BizCuit\\BXQuery\\Expense'
$search_fields
protected
mixed
$search_fields
= ['vendor', 'gross_min', 'gross_max', 'net_min', 'net_max', 'paid_on_start', 'paid_on_end', 'created_at_start', 'created_at_end', 'title', 'currency_code', 'document_no', 'supplier_id', 'project_id']
$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
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
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.
getIdName()
Get ID name for version 4 of the API.
public
getIdName() : string
Tags
Return values
stringgetType()
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 request for version 4 of the API.
public
list(int $offset, int $limit) : array<string|int, mixed>
Parameters
- $offset : int
- $limit : int
Tags
Return values
array<string|int, mixed>new()
Create a new BXObject.
public
new() : BXObject
Return values
BXObject —New empty BXObject.
newQuery()
Create new query for version 4 of the API.
public
newQuery() : BXQuery
Tags
Return values
BXQuerysearch()
Search request for version 4 of the API.
public
search(BXQuery $query[, int $offset = 0 ][, int $limit = 100 ]) : array<string|int, mixed>
Parameters
- $query : BXQuery
- $offset : int = 0
- $limit : int = 100
Tags
Return values
array<string|int, mixed>set()
Set an item in the collection
public
set(BXObject $content) : BXObject|false
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
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