Index
-
\com\setasign\Konquadrat
-
Object
- AbstractCachingDocument
- AbstractObject
- AbstractObjectInterface
- AbstractObjectSet
- Action
- ActionResolver
- ActionResolverInterface
- Custom
- Database
- DocumentInterface
- DocumentResolver
- DocumentResolverInterface
- GlobalDiWakeupObjectResolver
- History
- ImportInterface
- InitTraitResolver
- InitTraitResolverInterface
- InstancePool
- InstancePoolInterface
- InstancePoolManager
- ManualQueryBuilder
- MassActionResolver
- MassActionResolverInterface
- MessageList
- MissingConfigurationException
- ObjectConfig
- ObjectFactory
- ObjectFactoryInterface
- ObjectFinder
- ObjectManager
- ObjectSaveException
- ObjectSet
- ObjectSet
- ObjectTableManager
- Scope
- Selector
- SmartObjectSet
- TemporaryReference
- TransactionManager
- UnknownObjectException
- WakeupObjectResolverInterface
-
Object
com\setasign\Konquadrat\Object
ObjectFinder Describes a logger-aware instance.
File: /Konquadrat/src/Object/ObjectFinder.php
Class hierarchy
Implements
- \Psr\Log\LoggerAwareInterface
Summary
Methods
- __construct()
- buildSelect()
- createObjectSet()
- createObjectSetByArray()
- get()
- getAllReferencingObjects()
- getById()
- getByName()
- getByUuid()
- getChilds()
- getCount()
- getDataById()
- getReferencingObjects()
- getSet()
- getShowDeleted()
- getSingleObject()
- getSmartSet()
- setLogger()
- setSessionContext()
- setShowDeleted()
Properties
$database
$gridFactory
$instancePoolManager
$languageManager
$logger
$objectConfig
$objectFactory
$objectSetFactory
$objectTableManager
Methods
__construct()
\com\setasign\SetaFramework\Database\Database $database,
ObjectFactoryInterface $objectFactory,
ObjectTableManager $objectTableManager,
\com\setasign\Konquadrat\LanguageManager $languageManager,
\com\setasign\Konquadrat\Grid\GridFactoryInterface $gridFactory,
InstancePoolManager $instancePoolManager,
ObjectSet\ObjectSetFactoryInterface $objectSetFactory
Parameters
- $objectConfig: ObjectConfig
- $database: \com\setasign\SetaFramework\Database\Database
- $objectFactory: ObjectFactoryInterface
- $objectTableManager: ObjectTableManager
- $languageManager: \com\setasign\Konquadrat\LanguageManager
- $gridFactory: \com\setasign\Konquadrat\Grid\GridFactoryInterface
- $instancePoolManager: InstancePoolManager
- $objectSetFactory: ObjectSet\ObjectSetFactoryInterface
buildSelect()
createObjectSetByArray()
Parameters
- $objects: AbstractObject[]
get()
WARNING: This method is marked as deprecated!
Use getSet() or getSingleObject() instead. Note: getSingleObject will throw an exception if nothing is found!
Get one or multiple objects which match on the given objectSelector.
Templates
Parameters
- $selector: Selector<T>
Return Values
AbstractObject or null will be returned if $limit is 1. Otherwise, an ObjectSet will be returned.
getAllReferencingObjects()
Check for references pointing on the object(s).
Warning: This method should be used with care because it can need some time and database performance.
Parameters
- $ids: int|int[]|AbstractObjectSet
- $recursive: bool
- $ignoreDeletedObjects: bool
We ignore deleted objects otherwise objects with deleted childs which require a parent will never be deletable
Return Values
False if no referencing objects found
getById()
?class-string<T> $expectedType = null,
bool $smart = false
Gets an object by id.
This method uses the instance from the objectFactory if possible.
Templates
Parameters
- $id: int
- $expectedType: ?class-string<T>
- $smart: bool
If true the object will be loaded from a smart object set.
Exceptions
Throws UnknownObjectException
getByName()
?class-string<T> $expectedType = null,
bool $smart = false
Gets an object by name (only for namedObjects).
Templates
Parameters
- $name: string
- $expectedType: ?class-string<T>
- $smart: bool
If true the object will be loaded from a smart object set.
Exceptions
Throws UnknownObjectException
getByUuid()
?class-string<T> $expectedType = null,
bool $smart = false
Gets an object by uuid.
Templates
Parameters
- $uuid: string
- $expectedType: ?class-string<T>
- $smart: bool
If true the object will be loaded from a smart object set.
Exceptions
Throws UnknownObjectException
getChilds()
Get all childs for one or multiple objects.
Parameters
- $parentIds: int|int[]
- $onlyTypes: null|string|string[]
- $objectSet: ?ObjectSet
Only for internal use! The resulting ObjectSet will be linked with this ObjectSet.
getDataById()
Gets the data of an object by id.
This method doesn't use the objectFactory and should be used with care.
Parameters
- $id: int
- $expectedType: ?string
The expected object type. The method will not check whether the object is really an object of this type, it is only used to build the joinedTable! It is only used if the type is a final object type.
Exceptions
Throws UnknownObjectException
getReferencingObjects()
Get all objects of $type that are referencing on an object of $ids over the reference field $field.
Parameters
- $ids: int|int[]
- $type: string
- $field: string
- $objectSet: ?ObjectSet
Only for internal use! The resulting ObjectSet will be linked with this ObjectSet.
getSet()
getShowDeleted()
Get the status of the "show deleted"-flag. The flag is false by default.
When used in Backend the flag in the session will only be used if the user has the AdminPermission::PERMISSION_ACTION_SHOW_DELETED.
getSingleObject()
Templates
Parameters
- $selector: Selector<T>
- $smart: bool
If true the object will be loaded from a smart object set.
Exceptions
Throws UnknownObjectException
getSmartSet()
Get one or multiple objects which match on the given objectSelector.
Returns a smart object set.
The main differences between normal object sets and smart object sets is that the smart object set doesn't provide methods to eager load other objects related to the object in this set. Instead of this it will load the required objects by itself. The main draw back for this is that the smart set will never use the instance pool and will ALWAYS load objects from the database if they aren't in this object set.
A smart object set is meant for usage in foreach loops with one time usage of every object instance and isn't meant for any other use-case!
Templates
Parameters
- $selector: Selector<T>
See
setSessionContext()
Parameters
- $sessionContext: \com\setasign\Konquadrat\SessionContext
setShowDeleted()
Set the status of the "show deleted"-flag.
Note: switching the flag on runtime should be used with care. ObjectSet and InstancePool might behave strange.
Parameters
- $show: bool
Status whether to show the deleted
- $temporary: bool
If false the status will be saved in the actual session.
