src/Utils/Generators/CoreConfigDataUidGenerator.php
/**
     * Create a unique identifier for the passed 'core_config_data' entity.
     *
     * @param array $entity The entity to generate the UID for
     *
     * @return string The unique identifier
     * @throws \InvalidArgumentException Is thrown if the passed entity doesn't contain the necessary members
     * @see \TechDivision\Import\Utils\Generators\GeneratorInterface::generate()
     */
Create a unique identifier for the passed 'core_config_data' entity.
@param array $entity The entity to generate the UID for


Create a unique identifier for the passed ' core_config_data ' entity . @param array $entity The entity to generate the UID for
public function generate(array $entity = array())
    {
        if (isset($entity[MemberNames::PATH]) &&
            isset($entity[MemberNames::SCOPE]) &&
            isset($entity[MemberNames::SCOPE_ID])
        ) {
            $path = $entity[MemberNames::PATH] ?? 'unknown';
            $scope = $entity[MemberNames::SCOPE] ?? 'unknown';
            $scopeId = $entity[MemberNames::SCOPE_ID] ?? 'unknown';
            return sprintf('%s/%s/%s', $scope, $scopeId, $path);
        }
        throw new \InvalidArgumentException('Can\'t generate UID from members of the passed entity');
    }
public function generate ( array $ entity = array ( ) ) { if ( isset ( $ entity [ MemberNames :: PATH ] ) && isset ( $ entity [ MemberNames :: SCOPE ] ) && isset ( $ entity [ MemberNames :: SCOPE_ID ] ) ) { $ path = $ entity [ MemberNames :: PATH ] ?? 'unknown' ; $ scope = $ entity [ MemberNames :: SCOPE ] ?? 'unknown' ; $ scopeId = $ entity [ MemberNames :: SCOPE_ID ] ?? 'unknown' ; return sprintf ( '%s/%s/%s' , $ scope , $ scopeId , $ path ) ; } throw new \ InvalidArgumentException ( 'Can\'t generate UID from members of the passed entity' ) ; }
Create a unique identifier for the passed 'core_config_data' entity.
Create a unique identifier for the passed ' core_config_data ' entity .
// query whether or not the entity has the necessary members // to generate the UID for the core configuation // load the data to generate the entity with // generate and return the entity // throw an exception, if the UID can not be generated