Welcome Guest, Not a member yet? Register   Sign In
One-way relationships with DataMapper?
#2

[eluser]mscott809[/eluser]
I guess the question might be, can I just define the relationship on one model and not the other, or will DataMapper have issues with that? (I see from the FAQ and other questions posted here that this is something people accidentally do fairly frequently. But if I intentionally do this, will I get the one-way relationship behavior I'm looking for, or will I just get a pants-load of trouble?)

Code:
class User extends DataMapper {
  var $has_one = array();
  var $has_many = array();
}

class Record extends DataMapper {
  var $has_one = array(
    'last_mod_by' => array(
      'class' => 'User',
      'other_field' => ''
    )
  );
  var $has_many = array();
}


Messages In This Thread
One-way relationships with DataMapper? - by El Forum - 07-01-2011, 05:29 PM
One-way relationships with DataMapper? - by El Forum - 07-01-2011, 06:26 PM
One-way relationships with DataMapper? - by El Forum - 07-02-2011, 03:13 AM
One-way relationships with DataMapper? - by El Forum - 07-02-2011, 09:13 AM
One-way relationships with DataMapper? - by El Forum - 07-02-2011, 09:44 AM
One-way relationships with DataMapper? - by El Forum - 07-02-2011, 11:23 AM
One-way relationships with DataMapper? - by El Forum - 07-02-2011, 01:50 PM
One-way relationships with DataMapper? - by El Forum - 07-02-2011, 03:32 PM
One-way relationships with DataMapper? - by El Forum - 07-02-2011, 04:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB