<?php
/**
* Entier Studio
*
* LICENSE
*
* Copyright 2006 Entier Studio team.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package entier.framework
* @copyright Copyright (c) 2006 Entier Studio team. All rights reserved.
* @version $Id: datalist.php 81 2008-01-17 23:08:21Z yannromefort $
*/
//-----------------------------------------------------------------------------
// namespace
if (!defined("DefDataList")) {
//-------------------------------------------------------------------------
// Define
define("DefDataList", "1");
//-------------------------------------------------------------------------
// Class
class DataList {
//---------------------------------------------------------------------
// Attributes
/**
* Fields List
* @var array
*/
var $m_fieldSet = NULL;
/**
* Values List
* @var array
*/
var $m_ValueSet = array();
//---------------------------------------------------------------------
// Constructor
/**
* base constructor
*/
function DataList() {
//
}
//---------------------------------------------------------------------
// Properties
/*
* Fields set properties
*/
/**
* Return fieldSet
* @return array
*/
function fieldSet() {
//
if (!is_array($this->m_fieldSet)) {
$fieldSet = @array_keys($this->m_ValueSet[0]);
if (!is_array($fieldSet)) return (false);
//
$this->m_fieldSet = $fieldSet;
}
//
return ($this->m_fieldSet);
}
/**
* Fields Count
* @return integer
*/
function FieldCount() {
//
return (@count($this->fieldSet()));
}
/**
* @return variant
*/
function get_row_fields() {
//
return (@each($this->fieldSet()));
}
/*
* Values set properties
*/
/**
* Return ValueSet
* @return array
*/
function ValueSet() {
//
return ($this->m_ValueSet);
}
/**
* Rows Count
* @return integer Count
*/
function RowCount() {
//
return (@count($this->m_ValueSet));
}
/**
* @param array
* @return boolean
*/
function set_row_values($row) {
//
if (!is_array($this->m_ValueSet)) return (false);
//
$this->m_ValueSet[] = $row;
return (true);
}
/**
* @param array
* @return variant
*/
function get_row_values() {
//
if (!is_array($this->m_ValueSet)) return (false);
//
return (@each($this->m_ValueSet));
}
};
// Class
//-------------------------------------------------------------------------
}
// namespace
//-----------------------------------------------------------------------------
?>