|
@@ 138-146 (lines=9) @@
|
| 135 |
|
*/ |
| 136 |
|
public function getActiveRowProperty(ActiveRow $item, $key) |
| 137 |
|
{ |
| 138 |
|
if (preg_match("/^:([a-zA-Z0-9_$]+)\.([a-zA-Z0-9_$]+)(:([a-zA-Z0-9_$]+))?$/", $key, $matches)) { |
| 139 |
|
$relatedTable = $matches[1]; |
| 140 |
|
$relatedColumn = $matches[2]; |
| 141 |
|
$throughColumn = isset($matches[4]) ? $matches[4] : NULL; |
| 142 |
|
|
| 143 |
|
$relatedRow = $item->related($relatedTable, $throughColumn)->fetch(); |
| 144 |
|
|
| 145 |
|
return $relatedRow ? $relatedRow->{$relatedColumn} : NULL; |
| 146 |
|
} |
| 147 |
|
|
| 148 |
|
if (preg_match("/^([a-zA-Z0-9_$]+)\.([a-zA-Z0-9_$]+)(:([a-zA-Z0-9_$]+))?$/", $key, $matches)) { |
| 149 |
|
$referencedTable = $matches[1]; |
|
@@ 148-156 (lines=9) @@
|
| 145 |
|
return $relatedRow ? $relatedRow->{$relatedColumn} : NULL; |
| 146 |
|
} |
| 147 |
|
|
| 148 |
|
if (preg_match("/^([a-zA-Z0-9_$]+)\.([a-zA-Z0-9_$]+)(:([a-zA-Z0-9_$]+))?$/", $key, $matches)) { |
| 149 |
|
$referencedTable = $matches[1]; |
| 150 |
|
$referencedColumn = $matches[2]; |
| 151 |
|
$throughColumn = isset($matches[4]) ? $matches[4] : NULL; |
| 152 |
|
|
| 153 |
|
$referencedRow = $item->ref($referencedTable, $throughColumn); |
| 154 |
|
|
| 155 |
|
return $referencedRow ? $referencedRow->{$referencedColumn} : NULL; |
| 156 |
|
} |
| 157 |
|
|
| 158 |
|
return $item->{$key}; |
| 159 |
|
} |