<?php
namespace Lia;
abstract class Addon implements AddonInterface {
/**
* Fully qualified name ("app_namespace:name")
*/
protected string $fqn;
/**
* The short name of this addon ("classname")
*/
protected string $name;
/** App */
protected \Lia\AppInterface $app;
/** Liaison */
protected \Lia $lia;
public function __construct(\Lia\AppInterface $app){
$this->app = $app;
$this->lia = $app->lia;
$name_parts = explode("\\",get_class($this));
$this->name = strtolower(array_pop($name_parts));
$this->fqn = $this->app->getNamespace().':'.$this->name;
}
/** Get short name */
public function getName(): string{
return $this->name;
}
/** Get Fully Qualified Name */
public function getFqn(): string{
return $this->fqn;
}
public function onAppReady(\Lia\AppInterface $app, mixed $value){
}
}