Skip to content

Latest commit

 

History

History
45 lines (35 loc) · 1.22 KB

bulk-set-value.rst

File metadata and controls

45 lines (35 loc) · 1.22 KB

Bulk Set Value

You can use the Bulk\SetValueAction class to specify the value of a given field for a group of database records.

<?php
namespace App\Controller;

class PostsController extends AppController
{
    public function initialize()
    {
        parent::initialize();
        $this->Crud->mapAction('publishAll', [
            'className' => 'Crud.Bulk/SetValue',
            'field' => 'status',
            'value' => 'publish'
        ]);
    }
}

Configuration

Events

This is a list of events emitted from actions that extend Bulk\BaseAction.

Please see the events documentation</events> for a full list of generic properties and how to use the event system correctly.