PHP Code:
$query = $this->selectBuilderFactory
->create()
//->forUser($user) // possible to apply for any user, the current user will be applied by default
->from($entityType)
->withStrictAccessControl() // applies access control filter so that only records visible by the user will be returned
->build();
$collection = $this->entityManager
->getRDBRepository($entityType)
->clone($query)
->where([]) // some additional where clause
->find();
Leave a comment: