Skip to content

Commit

Permalink
Updating function signature
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Mar 27, 2014
1 parent 936d712 commit eba9fb3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/ORM/Association.php
Expand Up @@ -445,9 +445,11 @@ public function attachTo(Query $query, array $options = []) {
* source results.
*
* @param array $row
* @param boolean $joined Whether or not the row is a result of a direct join
* with this association
* @return array
*/
public function transformRow($row) {
public function transformRow($row, $joined) {
$sourceAlias = $this->source()->alias();
$targetAlias = $this->target()->alias();
if (isset($row[$sourceAlias])) {
Expand Down
6 changes: 4 additions & 2 deletions src/ORM/Association/BelongsToMany.php
Expand Up @@ -247,15 +247,17 @@ public function attachTo(Query $query, array $options = []) {
* source results.
*
* @param array $row
* @param boolean $joined Whether or not the row is a result of a direct join
* with this association
* @return array
*/
public function transformRow($row, $joined = false) {
public function transformRow($row, $joined) {
$alias = $this->junction()->alias();
if ($joined) {
$row[$this->target()->alias()][$this->_junctionProperty] = $row[$alias];
unset($row[$alias]);
}
$row = $this->_transformRow($row);
$row = $this->_transformRow($row, $joined);
return $row;
}

Expand Down
4 changes: 3 additions & 1 deletion src/ORM/Association/ExternalAssociationTrait.php
Expand Up @@ -91,9 +91,11 @@ public function requiresKeys($options = []) {
* source results.
*
* @param array $row
* @param boolean $joined Whether or not the row is a result of a direct join
* with this association
* @return array
*/
public function transformRow($row) {
public function transformRow($row, $joined) {
$sourceAlias = $this->source()->alias();
$targetAlias = $this->target()->alias();

Expand Down

0 comments on commit eba9fb3

Please sign in to comment.