3 class Dummy
extends ActiveMongo
7 class Model1
extends ActiveMongo
12 static $validates_presence_of = array(
16 function before_create()
23 $this->addIndex(array('a' => -1));
28 class Model2
extends ActiveMongo
33 static $validates_presence_of = array(
37 function M1_filter($obj)
39 if (!$obj InstanceOf MongoID
) {
40 if (isset($this->no_throw
)) {
43 throw new ActiveMongo_FilterException("Invalid M1 value");
50 $this->addIndex(array('M1'));
53 function update_refs($m1)
55 /* reset just in case */
57 $this->where('M1', $m1['_id']);
58 $this->Update(array('a' => $m1['a']));
63 class Model3
extends ActiveMongo
68 static $validates_presence_of = array(