Skip to content

Commit ddd88ef

Browse files
author
goldoraf
committed
Fixed SActiveRecord::to_array() (don't return relationships metas)
1 parent e4f60a2 commit ddd88ef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

orm/lib/active_record.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,11 @@ public function __repr()
137137

138138
public function to_array()
139139
{
140-
return $this->values;
140+
$values = array();
141+
foreach ($this->meta->attributes as $name => $column)
142+
if (!array_key_exists($name, $this->meta->relationships))
143+
$values[$name] = $this->values[$name];
144+
return $values;
141145
}
142146

143147
public function dump()

0 commit comments

Comments
 (0)