Hello,
can someone help with my issue.
I need to get data from DB based on arrayAnyOf query type.
I found the solutions here https://github.com/espocrm/espocrm/issues/2268
here is one that I've chose:
There are also several examples from other users too.
But my issue starts right after I'm adding the constuctor:
The ERROR returns this
Thank you
can someone help with my issue.
I need to get data from DB based on arrayAnyOf query type.
I found the solutions here https://github.com/espocrm/espocrm/issues/2268
here is one that I've chose:
yurikuzn commented on Apr 1, 2022 •
Using the select-builder framework.
Inject Espo\Core\Select\SelectBuilderFactory into your class.
Using the select-builder framework.
Inject Espo\Core\Select\SelectBuilderFactory into your class.
PHP Code:
$query = $this->selectBuilderFactory
->create()
->from('EntityType')
->withWhere(
(new \Espo\Core\Select\Where\ItemBuilder)
->setAttribute('companyType')
->setType('arrayAllOf')
->setValue(['Client', 'Introducer'])
->build()
)
->build();
$collection = $this->entityManager
->getRDBRepository('EntityType')
->clone($query)
->find();
There are also several examples from other users too.
But my issue starts right after I'm adding the constuctor:
PHP Code:
<?php
namespace Espo\Custom\Controllers;
use Espo\ORM\Entity;
use Espo\Core\Select\SelectBuilderFactory;
use Espo\Core\Api\Request;
class StockManager extends \Espo\Core\Templates\Controllers\BasePlus {
private SelectBuilderFactory $SelectBuilderFactory;
public function __construct(SelectBuilderFactory $SelectBuilderFactory) {
$this->selectBuilderFactory = $selectBuilderFactory;
}
ERROR: Slim Application Error Type: Error Code: 0 Message: Typed property Espo\Core\Controllers\RecordBase::$searchParamsFet cher must not be accessed before initialization File: /var/www/html/application/Espo/Core/Controllers/RecordBase.php Line: 291
Thank you
Comment