diff --git a/src/Row.php b/src/Row.php index c3a615a8..0e33ef13 100644 --- a/src/Row.php +++ b/src/Row.php @@ -92,6 +92,12 @@ public function getValue($key) return $this->item->{$this->formatDibiRowKey($key)}; } else if ($this->item instanceof ActiveRow) { + if (preg_match("/^:([a-zA-Z0-9_$]*)\.([a-zA-Z0-9_$]*)$/", $key, $matches)) { + $relatedTable = $matches[1]; + $relatedColumn = $matches[2]; + + return $this->item->related($relatedTable)->fetch()->{$relatedColumn}; + } return $this->item->{$key}; } else if ($this->item instanceof Nette\Database\Row) {