<?php
/**
 * YANA library
 *
 * @package yana
 * @licence http://creativecommons.org/licenses/by-nc-sa/2.5/
 */

/**
 * «abstract» Plugin
 *
 * This is an abstract super-class for all plugins.
 *
 * @abstract
 * @access      public
 * @package     yana
 * @subpackage  core
 */
class Plugin
{

    /**
     * @ignore
     * @access  private
     * @var     string */ var $name = "";
    
    /**
     * constructor
     *
     * Creates a new instance.
     *
     * @param string $name
     */ 
    function Plugin($name)
    {
        settype($name,"string");
        assert('!empty($name);');
        $this->name = $name;
    }
    
    /**
     * «abstract»  default event handler
     *
     * @access public
     * @abstract
     * @param string $event
     * @param array $ARGS
     * @return boolean
     */
    function _default ($event, $ARGS)
    {
        /* intentionaly left blank */
        return true;
    }

    /**
     * get the name of a plugin
     *
     * @access public
     * @return string
     */ 
    function getName()
    {
        assert('is_string($this->name) && !empty($this->name);');
        return $this->name;
    }

}

?>