mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Documented by https://github.com/wintercms/docs/pull/11 Co-authored-by: @jaxwilko Jack Wilkinson <me@jackwilky.com> Co-authored-by: @mjauvin Marc Jauvin <marc.jauvin@gmail.com> Co-authored-by: @bennothommo Ben Thomson <git@alfreido.com> Co-authored-by: @LukeTowers Luke Towers <github@luketowers.ca>
29 lines
707 B
PHP
29 lines
707 B
PHP
<?php namespace System\Traits;
|
|
|
|
/**
|
|
* Lazy Owner Alias
|
|
* Adds support for statically binding owner aliases
|
|
*
|
|
* @package winter\wn-system-module
|
|
* @author Jack Wilkinson
|
|
*/
|
|
trait LazyOwnerAlias
|
|
{
|
|
/**
|
|
* @var array List of aliases
|
|
*/
|
|
protected static $lazyAliases = [];
|
|
|
|
/**
|
|
* Binds the alias of an owner to the lazy alias list. This allows us to bind aliases
|
|
* prior to init() which is necessary to do before to `PluginManager` being registered.
|
|
* @param string $owner
|
|
* @param string $alias
|
|
* @return void
|
|
*/
|
|
public static function lazyRegisterOwnerAlias(string $owner, string $alias)
|
|
{
|
|
static::$lazyAliases[$alias] = $owner;
|
|
}
|
|
}
|