phpDataMapper icon indicating copy to clipboard operation
phpDataMapper copied to clipboard

Self refrencing relations

Open elicwhite opened this issue 15 years ago • 0 comments

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 );

elicwhite avatar May 05 '10 19:05 elicwhite