class Referenceitem extends DataMapper { var $has_many = array( 'file', 'child' => array( 'class' => 'referenceitem', 'other_field' => 'parent' ) ); var $has_one = array( 'parent' => array( 'class' => 'referenceitem', 'other_field' => 'child' ) ); function __construct($id = null) { parent::__construct($id); } }