src/Action/Bulk/ToggleAction.php
protected function _bulk(Query $query = null)
    {
        $field = $this->getConfig('field');
        $expression = [new QueryExpression(sprintf('%1$s= NOT %1$s', $field))];
        $query->update()->set($expression);
        $statement = $query->execute();
        $statement->closeCursor();

        return (bool)$statement->rowCount();
    }
protected function _bulk(Query $query = null)
    {
        $field = $this->getConfig('field');
        $expression = [new QueryExpression(sprintf('%1$s= NOT %1$s', $field))];
        $query->update()->set($expression);
        $statement = $query->execute();
        $statement->closeCursor();

        return (bool)$statement->rowCount();
    }
protected function _bulk ( Query $ query = null ) { $ field = $ this -> getConfig ( 'field' ) ; $ expression = [ new QueryExpression ( sprintf ( '%1$s= NOT %1$s' , $ field ) ) ] ; $ query -> update ( ) -> set ( $ expression ) ; $ statement = $ query -> execute ( ) ; $ statement -> closeCursor ( ) ; return ( bool ) $ statement -> rowCount ( ) ; }
Handle a bulk toggle

@param \Cake\ORM\Query|null $query The query to act upon
@return bool
Handle a bulk toggle