Nextcloud PHP API (master)

Entity
in package

AbstractYes
Tags
since
7.0.0
psalm-consistent-constructor

Table of Contents

Properties

$id  : int
$_fieldTypes  : array<string|int, mixed>
$_updatedFields  : array<string|int, mixed>

Methods

__call()  : mixed
Each time a setter is called, push the part after set into an array: for instance setId will save Id in the updated fields array so it can be easily used to create the getter method
columnToProperty()  : string
Transform a database columnname to a property
fromParams()  : static
Simple alternative constructor for building entities from a request
fromRow()  : static
Maps the keys of the row array to the attributes
getFieldTypes()  : array<string|int, mixed>
getId()  : int
getUpdatedFields()  : array<string|int, mixed>
propertyToColumn()  : string
Transform a property to a database column name
resetUpdatedFields()  : mixed
Marks the entity as clean needed for setting the id after the insertion
setId()  : void
slugify()  : string
Slugify the value of a given attribute Warning: This doesn't result in a unique value
addType()  : mixed
Adds type information for a field so that its automatically casted to that value once its being returned from the database
getter()  : mixed
Generic getter for properties
isGetterForBoolProperty()  : bool
markFieldUpdated()  : void
Mark am attribute as updated
setter()  : void
Generic setter for properties

Properties

$_fieldTypes

private array<string|int, mixed> $_fieldTypes = ['id' => 'integer']

$_updatedFields

private array<string|int, mixed> $_updatedFields = []

Methods

__call()

Each time a setter is called, push the part after set into an array: for instance setId will save Id in the updated fields array so it can be easily used to create the getter method

public __call(string $methodName, array<string|int, mixed> $args) : mixed
Parameters
$methodName : string
$args : array<string|int, mixed>
Tags
since
7.0.0

columnToProperty()

Transform a database columnname to a property

public columnToProperty(string $columnName) : string
Parameters
$columnName : string

the name of the column

Tags
since
7.0.0
Return values
string

the property name

fromParams()

Simple alternative constructor for building entities from a request

public static fromParams(array<string|int, mixed> $params) : static
Parameters
$params : array<string|int, mixed>

the array which was obtained via $this->params('key') in the controller

Tags
since
7.0.0
Return values
static

fromRow()

Maps the keys of the row array to the attributes

public static fromRow(array<string|int, mixed> $row) : static
Parameters
$row : array<string|int, mixed>

the row to map onto the entity

Tags
since
7.0.0
Return values
static

getFieldTypes()

public getFieldTypes() : array<string|int, mixed>
Tags
since
7.0.0
Return values
array<string|int, mixed>

with attribute and type

getId()

public getId() : int
Return values
int

getUpdatedFields()

public getUpdatedFields() : array<string|int, mixed>
Tags
since
7.0.0
Return values
array<string|int, mixed>

array of updated fields for update query

propertyToColumn()

Transform a property to a database column name

public propertyToColumn(string $property) : string
Parameters
$property : string

the name of the property

Tags
since
7.0.0
Return values
string

the column name

resetUpdatedFields()

Marks the entity as clean needed for setting the id after the insertion

public resetUpdatedFields() : mixed
Tags
since
7.0.0

setId()

public setId(int $id) : void
Parameters
$id : int

slugify()

Slugify the value of a given attribute Warning: This doesn't result in a unique value

public slugify(string $attributeName) : string
Parameters
$attributeName : string

the name of the attribute, which value should be slugified

Tags
since
7.0.0
deprecated
24.0.0
Return values
string

slugified value

addType()

Adds type information for a field so that its automatically casted to that value once its being returned from the database

protected addType(string $fieldName, string $type) : mixed
Parameters
$fieldName : string

the name of the attribute

$type : string

the type which will be used to call settype()

Tags
since
7.0.0

getter()

Generic getter for properties

protected getter(string $name) : mixed
Parameters
$name : string
Tags
since
7.0.0

isGetterForBoolProperty()

protected isGetterForBoolProperty(string $methodName) : bool
Parameters
$methodName : string
Tags
since
18.0.0
Return values
bool

markFieldUpdated()

Mark am attribute as updated

protected markFieldUpdated(string $attribute) : void
Parameters
$attribute : string

the name of the attribute

Tags
since
7.0.0

setter()

Generic setter for properties

protected setter(string $name, array<string|int, mixed> $args) : void
Parameters
$name : string
$args : array<string|int, mixed>
Tags
since
7.0.0

        
On this page

Search results