com\setasign\Konquadrat\Object

AbstractObjectInterface Interface AbstractObjectInterface

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

Implemented in

Implements

Summary

Constants

ACTION_DELETE

public const AbstractObjectInterface::ACTION_DELETE = 'delete'

ACTION_READ

public const AbstractObjectInterface::ACTION_READ = 'read'

ACTION_WRITE

public const AbstractObjectInterface::ACTION_WRITE = 'write'

NAME

public const AbstractObjectInterface::NAME = 'AbstractObject'

Methods

__call()

abstract public AbstractObjectInterface::__call (
string $name,
array $arguments
): ?mixed

Give some magic methods:

  • getField{$fieldName}() -> Alias for getField($fieldName)
  • getChild{$objectType}Objects() -> Alias for getChilds($objectType)
  • getReferencing{$objectType}ObjectsBy{$fieldName}Field() -> Alias for getReferencingObjects($objectType, $fieldName)
Parameters
$name : string
 
$arguments : array
 

__get()

Alias for get($fieldName, true)

Parameters
$fieldName : string
 
Exceptions

Throws MissingConfigurationException

See

__isset()

Checks whether $fieldName exists and the value is not null.

Parameters
$fieldName : string
 

__set()

abstract public \com\setasign\Konquadrat\Field\FieldContainer\FieldContainerInterface::__set (
string $fieldName,
mixed $value
): void

Alias for set($fieldName, $value)

Parameters
$fieldName : string
 
$value : mixed
 
See

addEventListener()

abstract public AbstractObjectInterface::addEventListener (
string $eventName,
string $name,
callable $callback
): void
Parameters
$eventName : string
 
$name : string

The name of this callback. The name is only unique for this method & object.

$callback : callable
 

callAction()

abstract public AbstractObjectInterface::callAction (
string $action,
array $additionalArguments = array ( )
): ?Action\ActionResponse
Parameters
$action : string
 
$additionalArguments : array
 
Exceptions

Throws \InvalidArgumentException If the action is unknown.

copyObjectData()

abstract public AbstractObjectInterface::copyObjectData (
AbstractObjectInterface $object,
null|string|string[] $onlyTypes = null
): self

Copy the data of $object into this object. All fields of AbstractObject will be ignored (including the parent).

Parameters
$object : AbstractObjectInterface
 
$onlyTypes : null|string|string[]
 

delete()

abstract public AbstractObjectInterface::delete (
bool $recursive = true
): array

Marks the object as deleted and saves the object.

Existing references will not be unlinked, but you could find these objects with ObjectFinder::getReferencingObjects()!

This method will create a transaction if no transaction is active and revert everything if an error is thrown.

Parameters
$recursive : bool

Delete also all childs.

Return Values

Array with the ids of all deleted objects.

Exceptions

Throws \Throwable

get()

abstract public \com\setasign\Konquadrat\Field\FieldContainer\FieldContainerInterface::get (
string $fieldName,
bool $resolve = true
): ?mixed

Get the value of $fieldName.

Parameters
$fieldName : string
 
$resolve : bool

Resolve resolvable fields like reference and json fields.

getAs()

abstract public AbstractObjectInterface::getAs (
string $name
): \com\setasign\SetaFramework\FileSystem\File

Get the object as document of type $name

Parameters
$name : string
 
Exceptions

Throws \InvalidArgumentException If the name is invalid!

getChanged()

abstract public AbstractObjectInterface::getChanged (
void
): array

getChilds()

abstract public AbstractObjectInterface::getChilds (
null|class-string<T>|string[] $type = null
): ObjectSet<T>|SmartObjectSet<T>
Parameters
$type : null|class-string<T>|string[]
 

getData()

abstract public AbstractObjectInterface::getData (
bool $resolveMagicFields = true
): array

Returns the data of the fields of this object.

MultiLangString, MultiLangText and Password fields are ignored.

Parameters
$resolveMagicFields : bool
 

getField()

Gets the field instance of $fieldName.

Parameters
$fieldName : string
 
Exceptions

Throws MissingConfigurationException If the field isn't configured.

getFieldContainerName()

getFields()

Return all fields.

getInitialData()

abstract public AbstractObjectInterface::getInitialData (
void
): array

getMagicWithParam()

abstract public AbstractObjectInterface::getMagicWithParam (
string $fieldName,
array $parameters
): string
Parameters
$fieldName : string
 
$parameters : array
 

getPath()

abstract public AbstractObjectInterface::getPath (
void
): string

getPermissionResource()

abstract public AbstractObjectInterface::getPermissionResource (
void
): \com\setasign\SetaFramework\Permissions\ResourceDefinition

getReferencingObjects()

abstract public AbstractObjectInterface::getReferencingObjects (
class-string<T> $type,
string $field
): ObjectSet<T>|SmartObjectSet<T>
Parameters
$type : class-string<T>
 
$field : string
 

getTabHeader()

abstract public AbstractObjectInterface::getTabHeader (
void
): string

Get the text header which will be shown in the gui.

hasAction()

abstract public AbstractObjectInterface::hasAction (
string $action
): bool
Parameters
$action : string
 

hasDocument()

abstract public AbstractObjectInterface::hasDocument (
string $name
): bool
Parameters
$name : string
 

hasField()

Checks whether the object has the field $fieldName.

Parameters
$fieldName : string
 

isSettingData()

Will be true when the data from the database will be inserted into the object.

reload()

abstract public AbstractObjectInterface::reload (
void
): void

Reloads the object.

All changed data will be reset!!

Exceptions

Throws \BadMethodCallException If the object was never saved!

Throws UnknownObjectException If the object cannot be found!

removeEventListener()

abstract public AbstractObjectInterface::removeEventListener (
string $eventName,
string $name
): void
Parameters
$eventName : string
 
$name : string
 

resetField()

abstract public AbstractObjectInterface::resetField (
string $fieldName
): void

Resets the field to the initial value.

Parameters
$fieldName : string
 

save()

abstract public AbstractObjectInterface::save (
bool $force = false
): AbstractObjectInterface

Save the object.

Parameters
$force : bool

Save everytime no matter whether there was a change

Exceptions

Throws ObjectSaveException If an error occurs during the save process.

set()

abstract public AbstractObjectInterface::set (
string $fieldName,
mixed|\com\setasign\Konquadrat\Field\DefaultValue $value
): static

Sets the value for the field.

Parameters
$fieldName : string
 
$value : mixed|\com\setasign\Konquadrat\Field\DefaultValue
 

setData()

abstract public AbstractObjectInterface::setData (
array $data,
bool $ignoreMissingFields = false
): void

Set multiple fields at once.

Parameters
$data : array
 
$ignoreMissingFields : bool

If true unknown fields will just be ignored.

setLogger()

abstract public AbstractObjectInterface::setLogger (
\Psr\Log\LoggerInterface $logger
): void
Parameters
$logger : \Psr\Log\LoggerInterface
 

update()

This field will notify the field container that the field was updated.

Parameters
$field : \com\setasign\Konquadrat\Field\AbstractField