Bigtable/src/Table.php
public function checkAndMutateRow($rowKey, array $options = [])
    {
        $hasSetMutations = false;

        if (isset($options['predicateFilter'])) {
            $this->convertToProto($options, 'predicateFilter', FilterInterface::class);
        }
        if (isset($options['trueMutations'])) {
            $this->convertToProto($options, 'trueMutations', Mutations::class);
            $hasSetMutations = true;
        }
        if (isset($options['falseMutations'])) {
            $this->convertToProto($options, 'falseMutations', Mutations::class);
            $hasSetMutations = true;
        }
        if (!$hasSetMutations) {
            throw new \InvalidArgumentException('checkAndMutateRow must have either trueMutations or falseMutations.');
        }

        return $this->gapicClient
            ->checkAndMutateRow(
                $this->tableName,
                $rowKey,
                $options + $this->options
            )
            ->getPredicateMatched();
    }
public function checkAndMutateRow($rowKey, array $options = [])
    {
        $hasSetMutations = false;

        if (isset($options['predicateFilter'])) {
            $this->convertToProto($options, 'predicateFilter', FilterInterface::class);
        }
        if (isset($options['trueMutations'])) {
            $this->convertToProto($options, 'trueMutations', Mutations::class);
            $hasSetMutations = true;
        }
        if (isset($options['falseMutations'])) {
            $this->convertToProto($options, 'falseMutations', Mutations::class);
            $hasSetMutations = true;
        }
        if (!$hasSetMutations) {
            throw new \InvalidArgumentException('checkAndMutateRow must have either trueMutations or falseMutations.');
        }

        return $this->gapicClient
            ->checkAndMutateRow(
                $this->tableName,
                $rowKey,
                $options + $this->options
            )
            ->getPredicateMatched();
    }
public function checkAndMutateRow ( $ rowKey , array $ options = [ ] ) { $ hasSetMutations = false ; if ( isset ( $ options [ 'predicateFilter' ] ) ) { $ this -> convertToProto ( $ options , 'predicateFilter' , FilterInterface :: class ) ; } if ( isset ( $ options [ 'trueMutations' ] ) ) { $ this -> convertToProto ( $ options , 'trueMutations' , Mutations :: class ) ; $ hasSetMutations = true ; } if ( isset ( $ options [ 'falseMutations' ] ) ) { $ this -> convertToProto ( $ options , 'falseMutations' , Mutations :: class ) ; $ hasSetMutations = true ; } if ( ! $ hasSetMutations ) { throw new \ InvalidArgumentException ( 'checkAndMutateRow must have either trueMutations or falseMutations.' ) ; } return $ this -> gapicClient -> checkAndMutateRow ( $ this -> tableName , $ rowKey , $ options + $ this -> options ) -> getPredicateMatched ( ) ; }
Mutates the specified row atomically based on output of the filter.

Example:
```
use Google\Cloud\Bigtable\Mutations;

$mutations = (new Mutations)->upsert('family', 'qualifier', 'value');
$result = $table->checkAndMutateRow('rk1', ['trueMutations' => $mutations]);
```

```
// With predicate filter
use Google\Cloud\Bigtable\Filter;
use Google\Cloud\Bigtable\Mutations;

$mutations = (new Mutations)->upsert('family', 'qualifier', 'value');
$predicateFilter = Filter::qualifier()->exactMatch('cq');
$options = ['predicateFilter' => $predicateFilter, 'trueMutations' => $mutations];
$result = $table->checkAndMutateRow('rk1', $options);
```

@param string $rowKey The row key to mutate row conditionally.
@param array $options [optional] {
Configuration options.

@type FilterInterface $predicateFilter The filter to be applied to the specified
row. Depending on whether or not any results are yielded, either the
trueMutations or falseMutations will be executed. If unset, checks that the
row contains any values at all. Only a single condition can be set, however
that filter can be {@see Google\Cloud\Bigtable\Filter::chain()} or
{@see Google\Cloud\Bigtable\Filter::interleave()} which can wrap multiple other
filters.
WARNING: {@see Google\Cloud\Bigtable\Filter::condition()} is not supported.
@type Mutations $trueMutations Mutations to be atomically applied when the predicate
filter's condition yields at least one cell when applied to the row. Please note
either `trueMutations` or `falseMutations` must be provided.
@type Mutations $falseMutations Mutations to be atomically applied when the predicate
filter's condition does not yield any cells when applied to the row. Please note
either `trueMutations` or `falseMutations` must be provided.
}

@return bool Returns true if predicate filter yielded any output, false otherwise.
@throws ApiException If the remote call fails or operation fails
@throws \InvalidArgumentException If neither of $trueMutations or $falseMutations is set.
If $predicateFilter is not instance of {@see Google\Cloud\Bigtable\Filter\FilterInterface}.
If $trueMutations is set and is not instance of {@see Google\Cloud\Bigtable\Mutations}.
If $falseMutations is set and is not instance of {@see Google\Cloud\Bigtable\Mutations}.
Mutates the specified row atomically based on output of the filter .