v5:activerecord:getactiverecords
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
activerecord:getactiverecords [2015/12/04 22:35] – created mnewnham | activerecord:getactiverecords [2015/12/05 01:55] – mnewnham | ||
---|---|---|---|
Line 2: | Line 2: | ||
~~NOTOC~~ | ~~NOTOC~~ | ||
<WRAP right box> | <WRAP right box> | ||
- | == syntax | + | == Syntax |
- | mixed getActiveRecords( | + | |
- | string $tableName, | + | string $tableName, |
- | optional string | + | optional string |
- | optional mixed[] $bindarr=false, | + | optional mixed[] $bindarr=false, |
- | optional mixed[] $primaryKeyArray=false | + | optional mixed[] $primaryKeyArray=false |
- | ) | + | ) |
</ | </ | ||
- | /** | + | |
- | * GetActiveRecordsClass Performs an ' | + | |
- | * | + | |
- | * @param mixed $class This string represents the class of the current active record | + | |
- | * @param mixed $table Table used by the active record object | + | |
- | * @param mixed $whereOrderBy Where, order, by clauses | + | |
- | * @param mixed $bindarr | + | |
- | * @param mixed $primkeyArr | + | |
- | * @param array $extra Query extras: limit, offset... | + | |
- | * @param mixed $relations Associative array: table' | + | |
- | * @access public | + | |
- | * @return void | + | |
- | */ | + | |
- | function GetActiveRecordsClass( | + | |
- | $class, $table, | + | |
- | $extra=array(), | + | |
- | $relations=array()) | + | |
- | { | + | |
- | global $_ADODB_ACTIVE_DBS; | + | |
- | ## reduce overhead of adodb.inc.php -- moved to adodb-active-record.inc.php | + | |
- | ## if adodb-active-recordx is loaded -- should be no issue as they will probably use Find() | + | |
- | if (!isset($_ADODB_ACTIVE_DBS))include_once(ADODB_DIR.'/ | + | |
- | return adodb_GetActiveRecordsClass($this, | + | |
- | } | + | |
- | + | ||
- | function GetActiveRecords($table, | + | |
- | { | + | |
- | $arr = $this-> | + | |
- | return $arr; | + | |
- | } | + | |
===== Description ===== | ===== Description ===== | ||
+ | GetActiveRecordsClass Performs an ' | ||
+ | |||
+ | ===== Parameters ===== | ||
+ | |||
+ | ==== $tableName ==== | ||
+ | Table used by the active record object | ||
+ | ==== $where ==== | ||
+ | Where clause | ||
+ | ==== $bindarr ==== | ||
+ | For more information on the use of '' | ||
+ | ==== $primaryKeyArray ==== | ||
+ | |||
==== Usage ==== | ==== Usage ==== | ||
<code php> | <code php> | ||
Line 51: | Line 34: | ||
$db-> | $db-> | ||
- | $activeRecs | + | $table = ' |
- | + | $whereOrderBy = "name LIKE ' | |
+ | $primaryKeys | ||
+ | $activeRecArr | ||
+ | foreach($activeRecArr as $rec) | ||
+ | { | ||
+ | $rec->id = rand(); | ||
+ | $rec-> | ||
+ | } | ||
</ | </ | ||
{{tag> | {{tag> |
v5/activerecord/getactiverecords.txt · Last modified: 2018/07/02 14:19 by peterdd