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