code: public function slug(Entity $entity)
      {
          $config = $this->config();
          $value = $entity->get($config['field']);
          $entity->set($config['slug'], strtolower(Inflector::slug($value, $config['replacement'])));
      }
docs: Slug a field passed in the default config with its replacement.
  
  @param \Cake\ORM\Entity $entity The entity that is going to be updated.
  
  @return void