I'm wondering if anyone knows how to force a default filter on Contact. I've tried several ways without success, my code is never called. Here's an example of my latest attempt:
<?php
// File: Contact.php
//
// Contact.json
// {
// "repositoryClassName": "Espo\\Custom\\Repositories\\Contact"
// }
namespace Espo\Custom\Repositories; // Contact.php here
use Espo\Core\Templates\Repositories\Person;
use Espo\ORM\Query\SelectBuilder;
class Contact extends Person
{
protected function beforeFind(SelectBuilder $selectBuilder): void
{
parent::beforeFind($selectBuilder);
$selectBuilder->addWhere([
'cCountryCountryId' => "68a20dfb1f9cdf2ae"
]);
}
}
A little help would be appreciated. Thank you in advance.
<?php
// File: Contact.php
//
// Contact.json
// {
// "repositoryClassName": "Espo\\Custom\\Repositories\\Contact"
// }
namespace Espo\Custom\Repositories; // Contact.php here
use Espo\Core\Templates\Repositories\Person;
use Espo\ORM\Query\SelectBuilder;
class Contact extends Person
{
protected function beforeFind(SelectBuilder $selectBuilder): void
{
parent::beforeFind($selectBuilder);
$selectBuilder->addWhere([
'cCountryCountryId' => "68a20dfb1f9cdf2ae"
]);
}
}
A little help would be appreciated. Thank you in advance.