mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
type fixes
This commit is contained in:
@@ -31,6 +31,8 @@ namespace Espo\Modules\Crm\Jobs;
|
||||
|
||||
use Espo\Core\ORM\Entity as CoreEntity;
|
||||
|
||||
use Espo\Modules\Crm\Entities\Reminder;
|
||||
|
||||
use Espo\Core\{
|
||||
ORM\EntityManager,
|
||||
Utils\Config,
|
||||
@@ -80,7 +82,6 @@ class SubmitPopupReminders implements JobDataLess
|
||||
|
||||
$nowShifted = $dt->modify('-' . $pastHours . ' hours')->format('Y-m-d H:i:s');
|
||||
|
||||
/** @var iterable<\Espo\Modules\Crm\Entities\Reminder> $reminderList */
|
||||
$reminderList = $this->entityManager
|
||||
->getRDBRepository('Reminder')
|
||||
->where([
|
||||
@@ -165,7 +166,7 @@ class SubmitPopupReminders implements JobDataLess
|
||||
}
|
||||
}
|
||||
|
||||
protected function deleteReminder($reminder)
|
||||
protected function deleteReminder(Reminder $reminder): void
|
||||
{
|
||||
$this->entityManager->getRDBRepository('Reminder')->deleteFromDb($reminder->id);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ namespace Espo\Modules\Crm\Repositories;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
|
||||
/**
|
||||
* @extends \Espo\Core\Repositories\Database<\Espo\Modules\Crm\Entities\Account>
|
||||
*/
|
||||
class Account extends \Espo\Core\Repositories\Database
|
||||
{
|
||||
public function afterSave(Entity $entity, array $options = [])
|
||||
|
||||
@@ -29,4 +29,5 @@
|
||||
|
||||
namespace Espo\Modules\Crm\Repositories;
|
||||
|
||||
|
||||
class Call extends Meeting {}
|
||||
|
||||
@@ -30,17 +30,18 @@
|
||||
namespace Espo\Modules\Crm\Repositories;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
|
||||
use Espo\Services\Stream as StreamService;
|
||||
|
||||
use Espo\Core\Di;
|
||||
|
||||
/**
|
||||
* @extends \Espo\Core\Repositories\Database<\Espo\Modules\Crm\Entities\CaseObj>
|
||||
*/
|
||||
class CaseObj extends \Espo\Core\Repositories\Database implements
|
||||
Di\ServiceFactoryAware
|
||||
{
|
||||
use Di\ServiceFactorySetter;
|
||||
|
||||
protected $streamService;
|
||||
protected ?StreamService $streamService = null;
|
||||
|
||||
protected function afterSave(Entity $entity, array $options = [])
|
||||
{
|
||||
|
||||
@@ -31,20 +31,23 @@ namespace Espo\Modules\Crm\Repositories;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
|
||||
/**
|
||||
* @extends \Espo\Core\Repositories\Database<\Espo\Modules\Crm\Entities\Lead>
|
||||
*/
|
||||
class Contact extends \Espo\Core\Repositories\Database
|
||||
{
|
||||
public function afterSave(Entity $entity, array $options = [])
|
||||
{
|
||||
parent::afterSave($entity, $options);
|
||||
|
||||
$this->handleAfterSaveAccounts($entity, $options);
|
||||
$this->handleAfterSaveAccounts($entity);
|
||||
|
||||
if ($entity->has('targetListId')) {
|
||||
$this->relate($entity, 'targetLists', $entity->get('targetListId'));
|
||||
}
|
||||
}
|
||||
|
||||
protected function handleAfterSaveAccounts(Entity $entity, array $options = [])
|
||||
protected function handleAfterSaveAccounts(Entity $entity): void
|
||||
{
|
||||
$accountIdChanged = $entity->has('accountId') &&
|
||||
$entity->get('accountId') != $entity->getFetched('accountId');
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
|
||||
namespace Espo\Modules\Crm\Repositories;
|
||||
|
||||
/**
|
||||
* @extends \Espo\Core\Repositories\CategoryTree<\Espo\Modules\Crm\Entities\DocumentFolder>
|
||||
*/
|
||||
class DocumentFolder extends \Espo\Core\Repositories\CategoryTree
|
||||
{
|
||||
}
|
||||
|
||||
@@ -31,18 +31,26 @@ namespace Espo\Modules\Crm\Repositories;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
|
||||
/**
|
||||
* @extends \Espo\Core\Repositories\Database<\Espo\Modules\Crm\Entities\KnowledgeBaseArticle>
|
||||
*/
|
||||
class KnowledgeBaseArticle extends \Espo\Core\Repositories\Database
|
||||
{
|
||||
protected function beforeSave(Entity $entity, array $options = [])
|
||||
{
|
||||
parent::beforeSave($entity, $options);
|
||||
|
||||
$order = $entity->get('order');
|
||||
|
||||
if (is_null($order)) {
|
||||
$order = $this->min('order');
|
||||
|
||||
if (!$order) {
|
||||
$order = 9999;
|
||||
}
|
||||
|
||||
$order--;
|
||||
|
||||
$entity->set('order', $order);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
|
||||
namespace Espo\Modules\Crm\Repositories;
|
||||
|
||||
/**
|
||||
* @extends \Espo\Core\Repositories\CategoryTree<\Espo\Modules\Crm\Entities\KnowledgeBaseCategory>
|
||||
*/
|
||||
class KnowledgeBaseCategory extends \Espo\Core\Repositories\CategoryTree
|
||||
{
|
||||
}
|
||||
|
||||
@@ -31,12 +31,20 @@ namespace Espo\Modules\Crm\Repositories;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
|
||||
/**
|
||||
* @extends \Espo\Core\Repositories\Database<\Espo\Modules\Crm\Entities\Lead>
|
||||
*/
|
||||
class Lead extends \Espo\Core\Repositories\Database
|
||||
{
|
||||
public function beforeSave(Entity $entity, array $options = [])
|
||||
{
|
||||
if (!$entity->get('convertedAt') && $entity->get('status') === 'Converted' && $entity->isAttributeChanged('status')) {
|
||||
if (
|
||||
!$entity->get('convertedAt') &&
|
||||
$entity->get('status') === 'Converted' &&
|
||||
$entity->isAttributeChanged('status')
|
||||
) {
|
||||
$convertedAt = date('Y-m-d H:i:s');
|
||||
|
||||
$entity->set('convertedAt', $convertedAt);
|
||||
}
|
||||
|
||||
@@ -48,7 +56,7 @@ class Lead extends \Espo\Core\Repositories\Database
|
||||
parent::afterSave($entity, $options);
|
||||
|
||||
if ($entity->has('targetListId')) {
|
||||
$this->relate($entity, 'targetLists', $entity->get('targetListId'));
|
||||
$this->relate($entity, 'targetLists', $entity->get('targetListId'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
|
||||
namespace Espo\Modules\Crm\Repositories;
|
||||
|
||||
/**
|
||||
* @extends \Espo\Core\Repositories\Database<\Espo\Modules\Crm\Entities\TargetList>
|
||||
*/
|
||||
class TargetList extends \Espo\Core\Repositories\Database
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user