PHP Classes
Icontem

File: core/classes/Node.class.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Marius Zadara  >  PAX  >  core/classes/Node.class.php  
File: core/classes/Node.class.php
Role: Class source
Content type: text/plain
Description: Node class
Class: PAX
Interpret XML command scripts with PHP classes
 

Contents

Class file image Download
<?php

/**
 * Page DocBlock definition
 * @package org.zadara.marius.pax
 */

/**
 * PAX general node definition.
 * This class is the root of all PAX nodes.
 * 
 * @author Marius Zadara <marius@zadara.org>
 * @category Classes
 * @copyright (C) 2008-2009 Marius Zadara
 * @license Free for non-comercial use
 * @package org.zadara.marius.pax
 * @abstract 
 * @see PAXObject
 * @see INode
 * @version 6.0
 * @since 5.0
 */
abstract class Node extends PAXObject implements INode  
{
    
/**
     * User object reference.
     *
     * @access protected
     * @var object
     */
    
protected $userObject;
    
    
    
/**
     * Current node attributes.
     *
     * @access protected
     * @var array
     */
    
protected $attributes;
    
    
    
    
/**
     * Current node content
     *
     * @access protected
     * @var string
     */
    
protected $content;
    
    
    
/**
     * Node constructor.
     *
     * @access public
     */
    
public function __construct()
    {
        
// init the parent
        
parent::__construct();
        
        
// init the user object and the attributes
        
$this->userObject null;
        
$this->attributes null;
        
$this->content null;
    }        

    
/**
     * Method to set the user object.
     *
     * @access public
     * @final 
     * @param object <b>$userObject</b> The user custom object
     * @return void
     */
    
public final function setUserObject(&$userObject)
    {
        
// set the object to the class member
        
$this->userObject $userObject;
    }
            
    
    
/**
     * Method to set the current attributes
     *
     * @access public
     * @final 
     * @param array <b>$attributes</b> List of the attributes
     * @return void
     */
    
public final function setAttributes(&$attributes)
    {
        
// set the current node's attributes to the class memeber
        
if (is_array($attributes))
            
$this->attributes $attributes;
    }
    
    
    
/**
     * Method to set the content of the node.
     *
     * @access public
     * @final 
     * @param string <b>$content</b> The content of the node
     * @return void
     */
    
public final function setContent($content)
    {
        
// set the content of the node
        
$this->content $content;
    }
    
    
    
/**
     * Method to reset the attributes to a null value.
     *
     * @access public
     * @final 
     * @return void
     */
    
public final function resetAttributes()
    {
        
// reset to null
        
$this->attributes null;
    }
    
    
    
/**
     * Reset the node content to a null value
     * 
     * @access public
     * @final 
     * @return void
     */
    
public final function resetContent()
    {
        
// reset the content
        
$this->content null;
    }
    
    
    
    
/**
     * Method to be called when the node starts.
     * It will be overwritten by every node implementation
     *
     * @access public
     * @abstract 
     * @return void
     */
    
public abstract function onOpen();

    
/**
     * Method to be called when the tag is complete (short form).
     *
     * @access public
     * @return void
     */
    
public function onComplete()
    {
        
// call the open method
        
$this->onOpen();
        
        
// call the close method
        
$this->onClose();
    }

    
/**
     * Method to be called when the tag is closed.
     * It will be overwritten by every node implementation.
     *
     * @access public
     * @abstract 
     */
    
public abstract function onClose();

    
    
/**
     * Class destructor.
     */
    
function __destruct()
    {
            
    }        
}

?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products