protected function canDecryptField(EntityInterface $entity, string $field): bool
    {
        if (!$this->getTable()->hasField($field)) {
            return false;
        }
        $decryptAll = $this->getConfig('decryptAll');
        if ($decryptAll === true) {
            return true;
        }

        $fields = $this->getFields();
        if (!isset($fields[$field])) {
            return false;
        }

        $decrypt = $fields[$field]['decrypt'];
        if (is_callable($decrypt)) {
            $decrypt = $decrypt($entity, $field);
        }

        return $decrypt;
    }
protected function canDecryptField(EntityInterface $entity, string $field): bool
    {
        if (!$this->getTable()->hasField($field)) {
            return false;
        }
        $decryptAll = $this->getConfig('decryptAll');
        if ($decryptAll === true) {
            return true;
        }

        $fields = $this->getFields();
        if (!isset($fields[$field])) {
            return false;
        }

        $decrypt = $fields[$field]['decrypt'];
        if (is_callable($decrypt)) {
            $decrypt = $decrypt($entity, $field);
        }

        return $decrypt;
    }
protected function canDecryptField ( EntityInterface $ entity , string $ field ) : bool { if ( ! $ this -> getTable ( ) -> hasField ( $ field ) ) { return false ; } $ decryptAll = $ this -> getConfig ( 'decryptAll' ) ; if ( $ decryptAll === true ) { return true ; } $ fields = $ this -> getFields ( ) ; if ( ! isset ( $ fields [ $ field ] ) ) { return false ; } $ decrypt = $ fields [ $ field ] [ 'decrypt' ] ; if ( is_callable ( $ decrypt ) ) { $ decrypt = $ decrypt ( $ entity , $ field ) ; } return $ decrypt ; }
Returns true when the field can be decrypted.

@param \Cake\Datasource\EntityInterface $entity Entity object.
@param string $field Field name.
@return bool True is decryption is allowed.
Returns true when the field can be decrypted .