<?php

/**
 * Interface for base Object class.
 * 
 * This interface is provided as a common base for all framework classes.
 * There are now two main hierarchies, that direclty implements it, 
 * <em>Object</em> and <em>BaseException</em>.<br />
 * The framework doesn't do any explicit check on objects to see if they were
 * builded as implementing <em>IObject</em>.
 * If you need it, and can't modify your code to extend from <em>Object</em>, 
 * it's possible - and will allways be simpler - to implement this interface.
 * <br />
 * <strong>Note: </strong>special method <em>__clone()</em> is commented, 
 * because PHP's own <em>Exception</em> class doesn't allow it to be declared 
 * as public.
 * 
 * @author  $Author: pruna $
 * @package common
 * @version $Revision: 1.1 $
 * @created 05-Dic-2005
 * @modified $Date: 2005/12/06 02:56:45 $
 */
interface IObject {

    /**
     * This method catches calls to unimplemented methods.
     *
     * @access    public
     * @param     string    $name         Method called in this object
     * @param     array     $arguments    Parameters passed
     * @return    mixed
     */
    public function __call($name, $arguments);
    
    /**
     * Special method called when cloning an object.
     * An object's __clone() method cannot be called directly.
     * Usage example: $copy_of_object = clone $object;
     *
     * @access    public
     */
    // function __clone();
    
    /**
     * Constructor.
     *
     * @access    public
     */
    public function __construct();
    
    /**
     * Destructor.
     *
     * @access    public
     */
    public function __destruct();
    
    /**
     * Compares the specified object with this object for equality.
     *
     * @access    public
     * @param     mixed     $object    Object to be compared whit $this
     * @return    boolean
     */
    public function equals($object);
    
    /**
     * Returns string hash representation for this object.
     *
     * @access    public
     * @return    string
     */
    public function hashCode();
    
    /**
     * Magic method to <em>sleep</em> an object.
     * This method is called prior to serialization.
     *
     * @access    public
     * @return    array
     */
    public function __sleep();
    
    /**
     * Returns a string representation of this object.
     *
     * @access    public
     * @return    string
     */
    public function __toString();
    
    /**
     * Returns a SimpleXML representation of this object.
     * 
     * @access    public
     * @return    SimpleXML
     */
    public function toXML();
    
    /**
     * Returns a XML string representation of this object.
     * 
     * @access    public
     * @return    string
     */
    public function toXMLString();
    
    /**
     * Magic method to "unsleep" an object.
     * This method is called prior to unserialization.
     *
     * @access    public
     */
    public function __wakeup();
    
}

?>