public function isEncryptable(EntityInterface $entity): bool
    {
        $enabled = $this->getConfig('enabled');
        if (is_callable($enabled)) {
            $enabled = $enabled($entity);
            if (!is_bool($enabled)) {
                throw new RuntimeException('Condition callable must return a boolean.');
            }
        }

        return $enabled;
    }
public function isEncryptable(EntityInterface $entity): bool
    {
        $enabled = $this->getConfig('enabled');
        if (is_callable($enabled)) {
            $enabled = $enabled($entity);
            if (!is_bool($enabled)) {
                throw new RuntimeException('Condition callable must return a boolean.');
            }
        }

        return $enabled;
    }
public function isEncryptable ( EntityInterface $ entity ) : bool { $ enabled = $ this -> getConfig ( 'enabled' ) ; if ( is_callable ( $ enabled ) ) { $ enabled = $ enabled ( $ entity ) ; if ( ! is_bool ( $ enabled ) ) { throw new RuntimeException ( 'Condition callable must return a boolean.' ) ; } } return $ enabled ; }
Checks whether the given entity can be encrypted.

@param \Cake\Datasource\EntityInterface $entity Entity object.
@throws \RuntimeException When `condition` callable returns a non-boolean value.
@return bool True if encryption is allowed
Checks whether the given entity can be encrypted .