phpDataMapper
phpDataMapper copied to clipboard
Self refrencing relations
There is no support for self referencing relationships without writing out the entire mapper name.
Solution: add a "self" keyword to a relationship definition. Allow something like:
public $parent = array( 'type' => 'relation', 'relation' => 'HasOne', 'mapper' => 'self', 'where' => array('mptt_parent' => 'entityid') // Means the current mappers mptt_parent column = currently loaded entity id );