17 private static $processing =
false;
21 if (self::$processing)
23 return self::getAgentName();
26 self::$processing =
true;
31 self::$processing =
false;
39 private static function getAgentName(): string
41 return self::class .
"::execute();";
44 private function __construct()
53 private function run(): string
55 $types = $this->getTypes();
61 $logIds = $this->getLogIds($types);
67 foreach ($logIds as $logId)
69 \CSocNetLog::Delete($logId);
72 return self::getAgentName();
82 private function getLogIds(
array $types):
array
87 '@ENTITY_TYPE' => $types,
89 'limit' => $this->getLimit(),
96 return array_column($logIds,
'ID');
103 private function getTypes():
array
105 if (!Loader::includeModule(
'crm'))
111 SONET_CRM_LEAD_ENTITY,
112 SONET_CRM_CONTACT_ENTITY,
113 SONET_CRM_COMPANY_ENTITY,
114 SONET_CRM_DEAL_ENTITY,
115 SONET_CRM_ACTIVITY_ENTITY,
116 SONET_CRM_INVOICE_ENTITY,
117 SONET_CRM_ORDER_ENTITY,
118 SONET_CRM_SUSPENDED_LEAD_ENTITY,
119 SONET_SUSPENDED_CRM_CONTACT_ENTITY,
120 SONET_SUSPENDED_CRM_COMPANY_ENTITY,
121 SONET_CRM_SUSPENDED_DEAL_ENTITY,
122 SONET_CRM_SUSPENDED_ACTIVITY_ENTITY,
126 private function getLimit(): int
128 return (
int)Option::get(
'socialnetwork',
'FeedGarbageCollectorAgentLimit', 20);
static getList(array $parameters=array())