function AdoDBRecord($attributes = false) { AdoDBRecord_Base::initialize(); # TODO setup scoped attributes first if ($attributes && $attributes != ADODBRECORD_STUB) { $this->_attributes = $attributes; } }
function _parse_find_by($fields, $arguments) { # split fields and create conditions $fields = explode("_and_", $fields); $conditions = array(); foreach ($fields as $field) { $arg = array_shift($arguments); if (is_array($arg)) { $conditions[] = array("{$field} IN (?)", $arg); } else { $conditions[] = array("{$field} = ?", $arg); } } # prepare arguments array to contain array conditions if (!isset($arguments["conditions"])) { $arguments["conditions"] = array(); } if (!is_array($arguments["conditions"])) { $arguments["conditions"] = array($arguments["conditions"]); } # merge parsed conditions and call native finder $arguments = array_merge_recursive($arguments, array("conditions" => $conditions)); return AdoDBRecord_Base::find($arguments); }
function __set($property, $value) { AdoDBRecord_Base::parse_member($property, $value); return true; }
function init() { global $PREFIX_ADODB, $ADODB_FETCH_MODE; require_once "{$PREFIX_ADODB}adodb.inc.php"; $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; require_once "Base.class.php"; $registration = AdoDBRecord_Tools::registration(); $registration->_column_cache = array(); AdoDBRecord_Base::register_hooks(); }
private function __set($property, $value) { AdoDBRecord_Base::parse_member($property, $value); }
function &find_all($arguments) { array_unshift($arguments, "all"); return AdoDBRecord_Base::find($arguments); }