Skip to content

Commit

Permalink
Return early if dot syntax is not being used.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdustinh committed Oct 27, 2017
1 parent 2784f16 commit 95496ed
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/ORM/Table.php
Expand Up @@ -897,18 +897,18 @@ public function association($name)
*/
public function getAssociation($name)
{
if (strpos($name, '.') !== false) {
list($name, $next) = array_pad(explode('.', $name, 2), 2, null);
$result = $this->_associations->get($name);
if (strpos($name, '.') === false) {
return $this->_associations->get($name);
}

if ($result !== null && $next !== null) {
$result = $result->getTarget()->association($next);
}
list($name, $next) = array_pad(explode('.', $name, 2), 2, null);
$result = $this->_associations->get($name);

return $result;
if ($result !== null && $next !== null) {
$result = $result->getTarget()->association($next);
}

return $this->_associations->get($name);
return $result;
}

/**
Expand Down

0 comments on commit 95496ed

Please sign in to comment.