use removeAll() in scheduler task

后端 未结 1 2024
余生分开走
余生分开走 2021-01-24 01:16

Before doing new stuff, i want my scheduler-Task to remove all entries from the database, the execute-function looks like that:

public function execute() {

  $o         


        
1条回答
  •  伪装坚强ぢ
    2021-01-24 02:00

    Since removeAll() calls findAll():

    public function removeAll() {
            foreach ($this->findAll() AS $object) {
                $this->remove($object);
            }
        }
    

    most likely findAll() returns no objects. Did you handle the storage pid? Either disable it or pass it manually. It won't be just there if you use methods of your repository from scheduler context.

    0 讨论(0)
提交回复
热议问题