{
$myID = $this->properties['id'];
- $this->import( $otherBean->export() );
+ $this->import( $otherBean->export( FALSE, FALSE, TRUE ) );
$this->id = $myID;
$hasSQL = ($this->withSql !== '' || $this->via !== NULL);
$exists = isset( $this->properties[$property] );
$fieldLink = $property . '_id';
+ $isFieldLink = (($pos = strrpos($property, '_id')) !== FALSE) && array_key_exists( ($fieldName = substr($property, 0, $pos)), $this->properties );
+
if ( ($isOwn || $isShared) && (!$exists || $hasSQL || $differentAlias) ) {
throw new RedException( 'Cannot cast to bean.' );
}
}
+
+ if ( $isFieldLink ){
+ unset( $this->properties[ $fieldName ]);
+ $this->properties[ $property ] = NULL;
+ }
+
if ( $value === FALSE ) {
$value = '0';