concrete/src/Permission/Key/Key.php
public static function import(SimpleXMLElement $pk)
    {
        if ($pk['package']) {
            $app = Application::getFacadeApplication();
            $pkg = $app->make(PackageService::class)->getByHandle($pk['package']);
        } else {
            $pkg = null;
        }

        return self::add(
            $pk['category'],
            $pk['handle'],
            $pk['name'],
            $pk['description'],
            $pk['can-trigger-workflow'] ? 1 : 0,
            $pk['has-custom-class'] ? 1 : 0,
            $pkg
        );
    }
public static function import(SimpleXMLElement $pk)
    {
        if ($pk['package']) {
            $app = Application::getFacadeApplication();
            $pkg = $app->make(PackageService::class)->getByHandle($pk['package']);
        } else {
            $pkg = null;
        }

        return self::add(
            $pk['category'],
            $pk['handle'],
            $pk['name'],
            $pk['description'],
            $pk['can-trigger-workflow'] ? 1 : 0,
            $pk['has-custom-class'] ? 1 : 0,
            $pkg
        );
    }
public static function import ( SimpleXMLElement $ pk ) { if ( $ pk [ 'package' ] ) { $ app = Application :: getFacadeApplication ( ) ; $ pkg = $ app -> make ( PackageService :: class ) -> getByHandle ( $ pk [ 'package' ] ) ; } else { $ pkg = null ; } return self :: add ( $ pk [ 'category' ] , $ pk [ 'handle' ] , $ pk [ 'name' ] , $ pk [ 'description' ] , $ pk [ 'can-trigger-workflow' ] ? 1 : 0 , $ pk [ 'has-custom-class' ] ? 1 : 0 , $ pkg ) ; }
Import a permission key from a SimpleXMLElement element.

@param \SimpleXMLElement $pk

@return \Concrete\Core\Permission\Key\Key
Import a permission key from a SimpleXMLElement element .