summaryrefslogtreecommitdiff
path: root/framework/Data/ActiveRecord/Relations
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Data/ActiveRecord/Relations')
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php6
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php2
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php4
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php4
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php6
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php4
6 files changed, 13 insertions, 13 deletions
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php b/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php
index 5d20476c..d7278d64 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php
@@ -101,7 +101,7 @@ class TActiveRecordBelongsTo extends TActiveRecordRelation
{
if(count($collections[$hash]) > 1)
throw new TActiveRecordException('ar_belongs_to_multiple_result');
- $source->{$prop} = $collections[$hash][0];
+ $source->setColumnValue($prop, $collections[$hash][0]);
}
}
@@ -112,7 +112,7 @@ class TActiveRecordBelongsTo extends TActiveRecordRelation
public function updateAssociatedRecords()
{
$obj = $this->getContext()->getSourceRecord();
- $fkObject = $obj->{$this->getContext()->getProperty()};
+ $fkObject = $obj->getColumnValue($this->getContext()->getProperty());
$registry = $fkObject->getRecordManager()->getObjectStateRegistry();
if($registry->shouldPersistObject($fkObject))
{
@@ -122,7 +122,7 @@ class TActiveRecordBelongsTo extends TActiveRecordRelation
$source = $this->getSourceRecord();
$fkeys = $this->findForeignKeys($source, $fkObject);
foreach($fkeys as $srcKey => $fKey)
- $source->{$srcKey} = $fkObject->{$fKey};
+ $source->setColumnValue($srcKey, $fkObject->getColumnValue($fKey));
return true;
}
}
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php b/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php
index fea78e36..cbba3ebd 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php
@@ -105,7 +105,7 @@ class TActiveRecordHasMany extends TActiveRecordRelation
if($registry->shouldPersistObject($fkObjects[$i]))
{
foreach($fkeys as $fKey => $srcKey)
- $fkObjects[$i]->{$fKey} = $source->{$srcKey};
+ $fkObjects[$i]->setColumnValue($fKey, $source->getColumnValue($srcKey));
$success = $fkObjects[$i]->save() && $success;
}
}
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php b/framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php
index 7e942e67..0e176607 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php
@@ -215,7 +215,7 @@ class TActiveRecordHasManyAssociation extends TActiveRecordRelation
{
$i=0;
foreach($foreignKeys as $ref=>$fk)
- $obj->{$ref} = $row[$this->_association_columns[$i++]];
+ $obj->setColumnValue($ref, $row[$this->_association_columns[$i++]]);
}
return $obj;
}
@@ -372,7 +372,7 @@ class TActiveRecordHasManyAssociation extends TActiveRecordRelation
{
$data=array();
foreach($foreignKeys as $name=>$fKey)
- $data[$name] = $fkObject->{$fKey};
+ $data[$name] = $fkObject->getColumnValue($fKey);
return $data;
}
}
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php b/framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php
index 375c38ef..b22428ae 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php
@@ -116,7 +116,7 @@ class TActiveRecordHasOne extends TActiveRecordRelation
{
if(count($collections[$hash]) > 1)
throw new TActiveRecordException('ar_belongs_to_multiple_result');
- $source->{$prop} = $collections[$hash][0];
+ $source->setColumnValue($prop, $collections[$hash][0]);
}
}
@@ -133,7 +133,7 @@ class TActiveRecordHasOne extends TActiveRecordRelation
$source = $this->getSourceRecord();
$fkeys = $this->findForeignKeys($fkObject, $source);
foreach($fkeys as $fKey => $srcKey)
- $fkObject->{$fKey} = $source->{$srcKey};
+ $fkObject->setColumnValue($fKey, $source->getColumnValue($srcKey));
return $fkObject->save();
}
return true;
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php b/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php
index de6e5331..5a3ea50e 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php
@@ -110,7 +110,7 @@ abstract class TActiveRecordRelation
{
$ids=array();
foreach($properties as $property)
- $ids[] = is_object($obj) ? $obj->{$property} : $obj[$property];
+ $ids[] = is_object($obj) ? $obj->getColumnValue($property) : $obj[$property];
return sprintf('%x',crc32(serialize($ids)));
}
@@ -142,7 +142,7 @@ abstract class TActiveRecordRelation
{
$value = array();
foreach($keys as $name)
- $value[] = $result->{$name};
+ $value[] = $result->getColumnValue($name);
$values[] = $value;
}
return $values;
@@ -190,7 +190,7 @@ abstract class TActiveRecordRelation
{
$hash = $this->getObjectHash($source, $properties);
$prop = $this->getContext()->getProperty();
- $source->{$prop} = isset($collections[$hash]) ? $collections[$hash] : array();
+ $source->setColumnValue($prop, isset($collections[$hash]) ? $collections[$hash] : array());
}
}
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php b/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php
index c9b47d12..189d2c5e 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php
@@ -74,7 +74,7 @@ class TActiveRecordRelationContext
public function getPropertyValue()
{
$obj = $this->getSourceRecord();
- return $obj->{$this->getProperty()};
+ return $obj->getColumnValue($this->getProperty());
}
/**
@@ -185,7 +185,7 @@ class TActiveRecordRelationContext
if(($updateBelongsTo && $belongsTo) || (!$updateBelongsTo && !$belongsTo))
{
$obj = $this->getSourceRecord();
- if(!$this->isEmptyFkObject($obj->{$property}))
+ if(!$this->isEmptyFkObject($obj->getColumnValue($property)))
{
$context = new self($this->getSourceRecord(),$property);
$success = $context->getRelationHandler()->updateAssociatedRecords() && $success;