<?php
// Property of MindShare HDV LLC. This file cannot be used, altered, in any way without expressed written permission from MindShare HDV LLC.
/**
* Base for any VO object and provides the necessary functionality to interact with the {@link DAO} class.
*
* @copyright MindShareHDV 2008
* @version 1.0.0
* @author Dana Murad
* @file VO.php
*
* @todo
*/
abstract class VO
{
/**
* @desc table name DAO should act on
* @access protected
* @var string
*/
public $_tableName;
/**
* @desc Table's primary key field name (default is "id")
* @access protected
* @var string
*/
public $_pKey;
/**
* @desc Name of function to call for preparing/modifying data for database.
* @access protected
* @var string
*/
public $_prepareForDBFx;
/**
* @desc Name of function to call for preparing/modifying data for display
* @access protected
* @var string
*/
public $_prepareForDispFx;
/**
* @desc Class Constructor
*
* Sets default values of data members
*/
function __construct
(
)
{
}
/**
* @desc Sets all the variables of the child class with an associative array. Used by {@link DAO}
* @access public
* @param array $dataArr
*/
public function _setVars
(
$dataArr
)
{
if (is_array($dataArr))
{
foreach ($dataArr as $key => $val)
{
$this->$key = $val;
}
}
}
/**
* @desc Quick accessor for data members
*
* This can can be used to get a private data member of child by passing variable name.
* @access public
* @param string $name
* @return mixed
*/
public function _getValueByName
(
$name
)
{
return $this->$name;
}
/**
* @desc Get's All the data members of this class ()
*
* Returns public/protected/private members of child class and only protected and public members of this class. Does not return private members of this(parent) class.
* @access public
* @return array
*/
public function getObjectVars
(
)
{
return get_object_vars($this);
}
}