Hello,
I try to implement a custom Job for an entity to recalculate fomula by CRON. The Job is running but fails.
Here is my php-script in folder Jobs:
and I get this error.
Could anyone tell me, which method would not be defiend and how to repair that?
The entity is called "Klassen" (the app is workshop administration where the workshop has (school)-classes). I already thought it could be because of the word "Klassen"?
I try to implement a custom Job for an entity to recalculate fomula by CRON. The Job is running but fails.
Here is my php-script in folder Jobs:
PHP Code:
<?php
namespace Espo\Custom\Jobs;
use Espo\Core\Job\JobDataLess;
class RecalculateKlassen implements JobDataLess
{
public function run(): void
{
$entityManager = $this->getEntityManager();
$repository = $entityManager->getRepository('Klassen');
$records = $repository->find();
foreach ($records as $record) {
$entityManager->getFormulaManager()->run($record);
$entityManager->saveEntity($record);
}
}
}
Code:
[2024-12-15 15:22:01] CRITICAL: (0) Failed job 675ef41971db1e741. Call to undefined method Espo\Custom\Jobs\RecalculateKLassen::getEntityMana ger() :: /var/www/vhosts/xxx/xxx/custom/Espo/Custom/Jobs/RecalculateKlassen.php(11)
Could anyone tell me, which method would not be defiend and how to repair that?
The entity is called "Klassen" (the app is workshop administration where the workshop has (school)-classes). I already thought it could be because of the word "Klassen"?
Comment