com\setasign\Konquadrat\Object

History Class History

File: /Konquadrat/src/Object/History.php

Class hierarchy

Summary

Constants

ACTION_CONFIG_READ

public const History::ACTION_CONFIG_READ = '4'

ACTION_CREATE

public const History::ACTION_CREATE = '1'

ACTION_DOWNLOAD_FILE

public const History::ACTION_DOWNLOAD_FILE = '5'

ACTION_EVENT

public const History::ACTION_EVENT = '7'

ACTION_IMPORT

public const History::ACTION_IMPORT = '6'

ACTION_UPDATE

public const History::ACTION_UPDATE = '2'

ACTION_VIEW

public const History::ACTION_VIEW = '3'

Properties

$origin

$tableFactory

$taskId

protected ?non-empty-string History::$taskId

$userIp

protected ?non-empty-string History::$userIp

Methods

__construct()

addConfigRead()

public History::addConfigRead (
void
): self

Adds a ConfigReload history entry.

addCreate()

public History::addCreate (
int $objectId,
?\DateTime $forceDateTime = null
): self

Adds a create-history entry.

Parameters
$objectId: int
 
$forceDateTime: ?\DateTime
 

addDownload()

public History::addDownload (
int $objectId,
string $field,
string $file
): self

Adds a download history entry.

Parameters
$objectId: int
 
$field: string
 
$file: string
 

addEvent()

public History::addEvent (
int $objectId,
string $eventName,
array $parameters = array ( )
): self
Parameters
$objectId: int
 
$eventName: string
 
$parameters: array
 

addImport()

WARNING: This method is marked as deprecated!

The kind of import is deprecated and will be removed in the future.

public History::addImport (
int $objectId,
string $type
): self

Adds an import history entry.

Parameters
$objectId: int
 
$type: string
 

addUpdate()

public History::addUpdate (
int $objectId,
array $changes,
?\DateTime $forceDateTime = null
): self

Adds an update history entry.

Parameters
$objectId: int
 
$changes: array
 
$forceDateTime: ?\DateTime
 

getCreator()

public History::getCreator (
ObjectFinder $objectFinder,
int $objectId
): ?Custom\DataoriginObject
Parameters
$objectFinder: ObjectFinder
 
$objectId: int
 

getCreatorId()

public History::getCreatorId (
int $objectId
): ?int

Get the id of the creator.

Parameters
$objectId: int
 

getLastChange()

public History::getLastChange (
int $objectId
): ?array

Get the last change as array.

Parameters
$objectId: int
 

getLastEditor()

public History::getLastEditor (
ObjectFinder $objectFinder,
int $objectId
): ?Custom\DataoriginObject
Parameters
$objectFinder: ObjectFinder
 
$objectId: int
 

getLastEditorId()

public History::getLastEditorId (
int $objectId
): ?int

Get the id of the last editor.

Parameters
$objectId: int
 

getOrigin()

public History::getOrigin (
void
): ?int

getTaskId()

public History::getTaskId (
void
): ?string

getUpdateDetails()

public History::getUpdateDetails (
int $historyId
): ?array

Get the update details for $historyId.

Parameters
$historyId: int
 

getUserIp()

public History::getUserIp (
void
): ?string

processWithTemporaryOrigin()

public History::processWithTemporaryOrigin (
null|Custom\DataoriginObject|int $origin,
?string $ip,
string $taskId,
callable $callback
): void

Sets the origin, the ip and the taskId and calls the callback. This method will ALWAYS reset the origin, the ip and the taskId to the previous value after.

Parameters
$origin: null|Custom\DataoriginObject|int
 
$ip: ?string
 
$taskId: string
 
$callback: callable
 

setOrigin()

public History::setOrigin (
null|Custom\DataoriginObject|int $origin = null,
?string $ip = null
): self

Sets the actual origin and ip. This method will always set both if one parameter is null it will be reset.

Parameters
$origin: null|Custom\DataoriginObject|int
 
$ip: ?string
 

setTaskId()

public History::setTaskId (
?string $taskId
): self

Sets the actual task id.

Parameters
$taskId: ?string
 

showHistory()

public History::showHistory (
int $objectId
): array

Get the history for the object $objectId.

Parameters
$objectId: int