Model/Converter/ScopeConverter.php
public function convert($scopeId, $scope)
    {
        if (is_numeric($scopeId)) {
            return $scopeId;
        }

        $entities = $this->getEntityStore($scope);
        if (isset($entities[$scopeId])) {
            return $entities[$scopeId]->getId();
        }

        throw new ScopeConvertException(sprintf('Unable to process code "%s" for scope "%s"', $scopeId, $scope));
    }
public function convert($scopeId, $scope)
    {
        if (is_numeric($scopeId)) {
            return $scopeId;
        }

        $entities = $this->getEntityStore($scope);
        if (isset($entities[$scopeId])) {
            return $entities[$scopeId]->getId();
        }

        throw new ScopeConvertException(sprintf('Unable to process code "%s" for scope "%s"', $scopeId, $scope));
    }
public function convert ( $ scopeId , $ scope ) { if ( is_numeric ( $ scopeId ) ) { return $ scopeId ; } $ entities = $ this -> getEntityStore ( $ scope ) ; if ( isset ( $ entities [ $ scopeId ] ) ) { return $ entities [ $ scopeId ] -> getId ( ) ; } throw new ScopeConvertException ( sprintf ( 'Unable to process code "%s" for scope "%s"' , $ scopeId , $ scope ) ) ; }
Converts a string scope to integer scope id if needed

@param string|int   $scopeId Scope ID
@param string|mixed $scope   Scope
@return int
Converts a string scope to integer scope id if needed