src/Model/Behavior/SluggedBehavior.php
protected function _multiSlug(EntityInterface $entity) {
		$label = $this->getConfig('label');
		$field = current($label);
		$fields = (array)$entity->get($field);

		$locale = [];
		foreach ($fields as $locale => $_) {
			$res = null;
			foreach ($label as $field) {
				$res = $entity->get($field);
				if (is_array($entity->get($field))) {
					$res = $this->generateSlug($field[$locale], $entity);
				}
			}

			$locale[$locale] = $res;
		}
		$entity->set($this->getConfig('slugField'), $locale);
	}
protected function _multiSlug(EntityInterface $entity) {
		$label = $this->getConfig('label');
		$field = current($label);
		$fields = (array)$entity->get($field);

		$locale = [];
		foreach ($fields as $locale => $_) {
			$res = null;
			foreach ($label as $field) {
				$res = $entity->get($field);
				if (is_array($entity->get($field))) {
					$res = $this->generateSlug($field[$locale], $entity);
				}
			}

			$locale[$locale] = $res;
		}
		$entity->set($this->getConfig('slugField'), $locale);
	}
protected function _multiSlug ( EntityInterface $ entity ) { $ label = $ this -> getConfig ( 'label' ) ; $ field = current ( $ label ) ; $ fields = ( array ) $ entity -> get ( $ field ) ; $ locale = [ ] ; foreach ( $ fields as $ locale => $ _ ) { $ res = null ; foreach ( $ label as $ field ) { $ res = $ entity -> get ( $ field ) ; if ( is_array ( $ entity -> get ( $ field ) ) ) { $ res = $ this -> generateSlug ( $ field [ $ locale ] , $ entity ) ; } } $ locale [ $ locale ] = $ res ; } $ entity -> set ( $ this -> getConfig ( 'slugField' ) , $ locale ) ; }
Multi slug method

Handle both slug and label fields using the translate behavior, and being edited
in multiple locales at once

//FIXME

@param \Cake\Datasource\EntityInterface $entity
@return void
Multi slug method