Skip to content

Commit

Permalink
Adding some doc blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Dec 13, 2014
1 parent 05434ff commit 973ad3d
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/ORM/EagerLoader.php
Expand Up @@ -16,6 +16,7 @@

use Cake\Database\Statement\BufferedStatement;
use Cake\Database\Statement\CallbackStatement;
use Cake\ORM\Association;
use Cake\ORM\Query;
use Cake\ORM\Table;
use Closure;
Expand Down Expand Up @@ -84,6 +85,12 @@ class EagerLoader {
*/
protected $_matching;

/**
* A map of table aliases pointing to the association objects they represent
* for the query.
*
* @var array
*/
protected $_joinsMap = [];

/**
Expand Down Expand Up @@ -521,7 +528,17 @@ public function associationsMap($table) {
return $map;
}

public function addToJoinsMap($alias, $assoc) {
/**
* Registers a table alias, typically loaded as a join in a query, as belonging to
* an association. This helps hydrators know what to do with the columns coming
* from such joined table.
*
* @param string $alias The table alias as it appears in the query.
* @param \Cake\ORM\Association $assoc The association object the alias represents.
* will be normalized
* @return void
*/
public function addToJoinsMap($alias, Association $assoc) {
$this->_joinsMap[$alias] = [
'aliasPath' => $alias,
'instance' => $assoc,
Expand Down

0 comments on commit 973ad3d

Please sign in to comment.