Skip to content

Commit

Permalink
Removing translation methods from Entity
Browse files Browse the repository at this point in the history
  • Loading branch information
danschultz committed Jan 3, 2012
1 parent 03f4b1e commit 730db69
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 51 deletions.
33 changes: 0 additions & 33 deletions src/mesh/model/Entity.as
@@ -1,7 +1,5 @@
package mesh.model
{
import com.brokenfunction.json.decodeJson;

import flash.events.EventDispatcher;

import mesh.core.inflection.humanize;
Expand Down Expand Up @@ -88,36 +86,6 @@ package mesh.model
return obj != null && (this === obj || (reflect.clazz == obj.reflect.clazz && id === obj.id));
}

/**
* Copies the values from an object to this entity.
*
* @param object The object to copy from.
*/
public function fromObject(object:Object):void
{
copy(object, this);
}

/**
* Decodes a JSON string and copies the result to this entity.
*
* @param json A JSON string.
*/
public function fromJSON(json:String):void
{
fromObject(decodeJson(json));
}

/**
* Copies the values from a value object to this entity.
*
* @param vo The object to copy from.
*/
public function fromVO(vo:Object):void
{

}

private function handlePropertyChange(event:PropertyChangeEvent):void
{
propertyChanged(event.property.toString(), event.oldValue, event.newValue);
Expand Down Expand Up @@ -285,7 +253,6 @@ package mesh.model
}

private var _id:*;
[Bindable]
/**
* An object that represents the ID for this entity.
*/
Expand Down
12 changes: 0 additions & 12 deletions tests/mesh/Customer.as
Expand Up @@ -2,7 +2,6 @@ package mesh
{
import mesh.model.validators.PresenceValidator;

import mx.collections.ArrayList;
import mx.collections.IList;

public class Customer extends Person
Expand All @@ -24,16 +23,5 @@ package mesh
hasOne("account", {inverse:"customer", isMaster:true, foreignKey:"accountId"});
hasMany("orders", {inverse:"customer", isMaster:true});
}

override public function fromObject(object:Object):void
{
super.fromObject(object);
account = object.account != null ? new Account(object.account) : null;
address = object.address != null ? new Address(object.address.street, object.address.city) : null;
orders = object.orders != null ? new ArrayList(object.orders.map(function(order:Object, ...args):Order
{
return new Order(order);
})) : null;
}
}
}
6 changes: 0 additions & 6 deletions tests/mesh/Person.as
Expand Up @@ -19,11 +19,5 @@ package mesh
{
super(properties);
}

override public function fromObject(object:Object):void
{
super.fromObject(object);
name = object.name != null ? new Name(object.name.first, object.name.last) : null;
}
}
}

0 comments on commit 730db69

Please sign in to comment.