Inherits Iterator, and Countable.
Definition at line 121 of file join.inc.
◆ __construct()
JoinResultIterator::__construct |
( |
|
$join, |
|
|
|
$constraints |
|
) |
| |
Definition at line 131 of file join.inc.
138 $class =
$join->classes[$i];
139 $this->item->$class =
new $class;
JoinResult is an empty placeholder class.
query($class)
Performs a query against the database, returning an array of DataItem objects of the specified class.
◆ count()
JoinResultIterator::count |
( |
| ) |
|
Definition at line 145 of file join.inc.
148 trace(
"Number of Rows: {$this->rowCount}", 4);
150 return $this->rowCount;
trace($msg, $lvl=3, $callStack=null)
Send output to the trace log.
◆ current()
JoinResultIterator::current |
( |
| ) |
|
Definition at line 179 of file join.inc.
181 for($i = 0; $i <
count($this->join->classes); ++$i)
183 $class = $this->join->classes[$i];
184 $this->item->$class->populate($this->
current, $this->join->aliases[$this->item->$class->table]);
187 foreach($this->join->pseudos as $class => $lookup)
189 foreach($this->join->aliases as $table => $prefix)
191 $keyAlias =
"{$prefix}.{$lookup['index']}";
193 $key = $this->
current[$keyAlias];
195 if (array_key_exists($key, $lookup[
'items']))
197 $this->item->$class = $lookup[
'items'][$key];
◆ key()
JoinResultIterator::key |
( |
| ) |
|
◆ next()
JoinResultIterator::next |
( |
| ) |
|
◆ rewind()
JoinResultIterator::rewind |
( |
| ) |
|
Definition at line 153 of file join.inc.
155 if ($this->position == 0)
return;
162 $this->
query = $this->join->generateQuery($this->constraints);
168 $this->result = $db->prepare($this->
query);
169 $this->result->execute();
170 $this->rowCount = $this->result->rowCount();
171 $this->
current = $this->result->fetch();
173 catch(PDOException $e)
175 throw new FakoliException($e->getMessage());
static getConnection()
Retrieves a reference to the global database connection.
◆ valid()
JoinResultIterator::valid |
( |
| ) |
|
◆ $constraints
JoinResultIterator::$constraints |
◆ $current
JoinResultIterator::$current = null |
◆ $item
JoinResultIterator::$item |
◆ $join
JoinResultIterator::$join |
◆ $position
JoinResultIterator::$position = -1 |
◆ $query
JoinResultIterator::$query |
◆ $result
JoinResultIterator::$result |
The documentation for this class was generated from the following file:
- C:/code/cms.sonjara.com/framework/join.inc