src/Model/Behavior/SlugBehavior.php
protected function _getSlugStringFromEntity($entity, $separator)
    {
        $string = [];
        foreach ((array)$this->getConfig('displayField') as $field) {
            if ($entity->getError($field)) {
                throw new InvalidArgumentException(sprintf('Error while generating the slug, the field `%s` contains an invalid value.', $field));
            }
            $string[] = $value = Hash::get($entity, $field);
        }

        return implode($separator, $string);
    }
protected function _getSlugStringFromEntity($entity, $separator)
    {
        $string = [];
        foreach ((array)$this->getConfig('displayField') as $field) {
            if ($entity->getError($field)) {
                throw new InvalidArgumentException(sprintf('Error while generating the slug, the field `%s` contains an invalid value.', $field));
            }
            $string[] = $value = Hash::get($entity, $field);
        }

        return implode($separator, $string);
    }
protected function _getSlugStringFromEntity ( $ entity , $ separator ) { $ string = [ ] ; foreach ( ( array ) $ this -> getConfig ( 'displayField' ) as $ field ) { if ( $ entity -> getError ( $ field ) ) { throw new InvalidArgumentException ( sprintf ( 'Error while generating the slug, the field `%s` contains an invalid value.' , $ field ) ) ; } $ string [ ] = $ value = Hash :: get ( $ entity , $ field ) ; } return implode ( $ separator , $ string ) ; }
Gets the slug string based on an entity

@param \Cake\Datasource\EntityInterface $entity Entity
@param string $separator Separator
@return string
Gets the slug string based on an entity