Пытаюсь переопределять afterSave согласно документации https://github.com/espocrm/documenta...ith-primary.md
Файл custom\entities\repositories\TimeTracker.php
<?php
namespace Espo\Custom\Repositories;
class TimeTracker extends \Espo\Core\Templates\Repositories\Base
{
public function afterSave(Entity $entity, array $options = array())
{
$result = parent::afterSave($entity, $options);
return $result;
}
}
Получаю ошибку в логфайл:
[2018-07-09 14:01:41] Espo.ERROR: Uncaught Exception TypeError: "Argument 1 passed to
Espo\Custom\Repositories\TimeTracker::afterSave() must be an instance of
Espo\Custom\Repositories\Entity, instance of Espo\Custom\Entities\TimeTracker given,
called in /home/espotest/public_html/application/Espo/ORM/Repositories/RDB.php on line 155" at /home/espotest/public_html/custom/Espo/Custom/Repositories/TimeTracker.php line 8 {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Espo\\Custom\\Repositories\\TimeTracker::afterSave () must be an instance of Espo\\Custom\\Repositories\\Entity, instance of Espo\\Custom\\Entities\\TimeTracker given, called in /home/espotest/public_html/application/Espo/ORM/Repositories/RDB.php on line 155 at /home/espotest/public_html/custom/Espo/Custom/Repositories/TimeTracker.php:8)"} []
Файл custom\entities\repositories\TimeTracker.php
<?php
namespace Espo\Custom\Repositories;
class TimeTracker extends \Espo\Core\Templates\Repositories\Base
{
public function afterSave(Entity $entity, array $options = array())
{
$result = parent::afterSave($entity, $options);
return $result;
}
}
Получаю ошибку в логфайл:
[2018-07-09 14:01:41] Espo.ERROR: Uncaught Exception TypeError: "Argument 1 passed to
Espo\Custom\Repositories\TimeTracker::afterSave() must be an instance of
Espo\Custom\Repositories\Entity, instance of Espo\Custom\Entities\TimeTracker given,
called in /home/espotest/public_html/application/Espo/ORM/Repositories/RDB.php on line 155" at /home/espotest/public_html/custom/Espo/Custom/Repositories/TimeTracker.php line 8 {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Espo\\Custom\\Repositories\\TimeTracker::afterSave () must be an instance of Espo\\Custom\\Repositories\\Entity, instance of Espo\\Custom\\Entities\\TimeTracker given, called in /home/espotest/public_html/application/Espo/ORM/Repositories/RDB.php on line 155 at /home/espotest/public_html/custom/Espo/Custom/Repositories/TimeTracker.php:8)"} []
Comment