<?php
/*
* Copyright 2008 Blandware (http://www.blandware.com)
*
* 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.
*/
/**
* Contains base class for all daos.
*
* @package AtleapLite
* @author Roman Puchkovskiy
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/
/**
*/
require 'server_options.php';
require_once 'DB/DataObject.php';
require_once 'include/common.php';
/**
* Base class for all daos.
*
* @package AtleapLite
*/
class DB_DataObject_Base extends DB_DataObject
{
/**
* Fetches all elements.
*
* @param bool $doFind whether find() needs to be called before fetching
* @return array elements
*/
function fetchAll($doFind = true)
{
$result = array();
if ($doFind) {
$this->find();
}
while ($this->fetch()) {
$result[] = clone($this);
}
return $result;
}
/**
* Quotes the string so the DB will treat it as an identifier.
* Currently, this does not do anything!
*
* @param string $id the identifier to quote
* @return string quoted identifier
*/
function quoteIdentifier($id) {
return $id;
}
}
?>