Documentation

File extends DatabaseEntity
in package
Uses RetrievalTrait, HandleTrait

Table of Contents

$dbExpression  : array<string|int, mixed>
$dbTable  : string
__construct()  : mixed
add()  : File
all()  : array<string|int, static>
Get a list of all active objects of the calling class (user, role, session, organization, API key)
byId()  : static|null
Get an object (user, role, session, organization or API key) by its id
byIdentifier()  : object|null
Get a permission object (user or role) by one of its identifiers
byIdentifiers()  : array<string|int, object>
Get a list of permission objects (user or role) by one of their identifiers
byIds()  : array<string|int, static>
Get a list of objects (user, role, session, organization or API key) by their ids Unknown or inactive ids are skipped, and calling it without ids throws a database exception
byReference()  : File|null
byUuid()  : object|null
Get a permission object (user or role) by its uuid
byUuids()  : array<string|int, object>
Get a list of permission objects (user or role) by their uuids
created()  : string
extension()  : string
loadObject()  : void
name()  : string
reference()  : string
refresh()  : void
Refresh the current permission object (user, role, session, organization or API key) by clearing all its fields and setting them new
remove()  : void
replacedBy()  : File|null
replaceWith()  : void
size()  : int
type()  : string
update()  : void

Properties

$dbExpression

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

$dbTable

public static string $dbTable = "z_file"

Methods

__construct()

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

add()

public static add(string $reference[, string $name = "" ][, string $type = "" ][, string $extension = "" ], int $size) : File
Parameters
$reference : string
$name : string = ""
$type : string = ""
$extension : string = ""
$size : int
Return values
File —

all()

Get a list of all active objects of the calling class (user, role, session, organization, API key)

public static all() : array<string|int, static>
Return values
array<string|int, static> —

The list of active objects

byId()

Get an object (user, role, session, organization or API key) by its id

public static byId(int|string $id) : static|null
Parameters
$id : int|string

the id of the object

Return values
static|null —

the object if found, null if the id is unknown or inactive

byIdentifier()

Get a permission object (user or role) by one of its identifiers

public static byIdentifier(string $column, int|string $identifier) : object|null
Parameters
$column : string

The identifying column, e.g. "id" or "uuid"

$identifier : int|string

The value of the identifying column

Return values
object|null —

the permission object if found, null otherwise

byIdentifiers()

Get a list of permission objects (user or role) by one of their identifiers

public static byIdentifiers(string $column, array<string|int, int>|array<string|int, string> $identifiers) : array<string|int, object>
Parameters
$column : string

The identifying column, e.g. "id" or "uuid"

$identifiers : array<string|int, int>|array<string|int, string>

The values of the identifying column

Return values
array<string|int, object> —

The list of permission objects

byIds()

Get a list of objects (user, role, session, organization or API key) by their ids Unknown or inactive ids are skipped, and calling it without ids throws a database exception

public static byIds(int ...$ids) : array<string|int, static>
Parameters
$ids : int

The ids of the objects to retrieve

Return values
array<string|int, static> —

the objects that were found

byReference()

public static byReference(string $reference) : File|null
Parameters
$reference : string
Return values
File|null —

byUuid()

Get a permission object (user or role) by its uuid

public static byUuid(string $uuid) : object|null
Parameters
$uuid : string

the uuid of the object

Return values
object|null —

the permission object if found, null otherwise

byUuids()

Get a list of permission objects (user or role) by their uuids

public static byUuids(string ...$uuids) : array<string|int, object>
Parameters
$uuids : string

The uuids of the objects to retrieve

Return values
array<string|int, object> —

The list of permission objects

created()

public created() : string
Return values
string —

extension()

public extension() : string
Return values
string —

loadObject()

public loadObject(array<string|int, mixed> $data) : void
Parameters
$data : array<string|int, mixed>
Return values
void —

name()

public name() : string
Return values
string —

reference()

public reference() : string
Return values
string —

refresh()

Refresh the current permission object (user, role, session, organization or API key) by clearing all its fields and setting them new

public refresh() : void
Tags
throws
InvalidArgumentException

If this instance was already detached

throws
RuntimeException

If the object no longer exists (its fields are already cleared by then)

Return values
void —

remove()

public remove() : void
Return values
void —

replacedBy()

public replacedBy() : File|null
Return values
File|null —

replaceWith()

public replaceWith(File $file) : void
Parameters
$file : File
Return values
void —

size()

public size() : int
Return values
int —

type()

public type() : string
Return values
string —

update()

public update(string $reference[, string $name = "" ][, string $type = "" ][, string $extension = "" ], int $size) : void
Parameters
$reference : string
$name : string = ""
$type : string = ""
$extension : string = ""
$size : int
Return values
void —

Search results