BatchInterfaceNotImplementedException example

/** * @param array<array-key, array<string, mixed>> $data * * @throws BatchInterfaceNotImplementedException * * @return array<array-key, array<string, mixed>> */
    public function batchDelete($data)
    {
        if (!$this instanceof BatchInterface) {
            throw new BatchInterfaceNotImplementedException();
        }

        $results = [];
        foreach ($data as $key => $datum) {
            $id = $this->getIdByData($datum);

            try {
                $results[$key] = [
                    'success' => true,
                    'operation' => 'delete',
                    'data' => $this->delete($id),
                ];
$this->View()->assign(['success' => true]);
    }

    /** * Controller Action for the batchAction * Blocks batch actions implemented by the extended class * * @throws RuntimeException */
    public function batchAction()
    {
        throw new BatchInterfaceNotImplementedException();
    }

    /** * Controller Action for the batchDelete * Blocks batch actions implemented by the extended class * * @throws RuntimeException */
    public function batchDeleteAction()
    {
        throw new BatchInterfaceNotImplementedException();
    }
Home | Imprint | This part of the site doesn't use cookies.