public function decryptEntity(EntityInterface $entity, array $fields): EntityInterface
    {
        if (!$this->isEncryptable($entity)) {
            return $entity;
        }

        foreach ($fields as $field) {
            $value = $this->decryptEntityField($entity, $field);
            if ($value !== null) {
                $entity->set([$field => $value], ['guard' => false]);
                $entity->setDirty($field, false);
            }
        }

        return $entity;
    }
public function decryptEntity(EntityInterface $entity, array $fields): EntityInterface
    {
        if (!$this->isEncryptable($entity)) {
            return $entity;
        }

        foreach ($fields as $field) {
            $value = $this->decryptEntityField($entity, $field);
            if ($value !== null) {
                $entity->set([$field => $value], ['guard' => false]);
                $entity->setDirty($field, false);
            }
        }

        return $entity;
    }
public function decryptEntity ( EntityInterface $ entity , array $ fields ) : EntityInterface { if ( ! $ this -> isEncryptable ( $ entity ) ) { return $ entity ; } foreach ( $ fields as $ field ) { $ value = $ this -> decryptEntityField ( $ entity , $ field ) ; if ( $ value !== null ) { $ entity -> set ( [ $ field => $ value ] , [ 'guard' => false ] ) ; $ entity -> setDirty ( $ field , false ) ; } } return $ entity ; }
Decrypts entity fields and runs the conditions check to determine whether
the given entity can be decrypted.

@param \Cake\Datasource\EntityInterface $entity Entity object.
@param string[] $fields Fields to decrypt.
@return \Cake\Datasource\EntityInterface Entity object.
Decrypts entity fields and runs the conditions check to determine whether the given entity can be decrypted .