function ServiceNodeMapper() { parent::EntityDataMapper(); $node_mapper = new CompositeMapper(); $node_mapper->registerMapper(new LimbHandle(LIMB_DIR . '/core/data_mappers/TreeNodeDataMapper')); $node_mapper->registerMapper(new LimbHandle(LIMB_DIR . '/core/data_mappers/NodeConnectionMapper')); $this->registerPartMapper('node', $node_mapper); $this->registerPartMapper('service', new LimbHandle(LIMB_DIR . '/core/data_mappers/ServiceLocationMapper')); }
function ContentServiceNodeMapper($table_class_name) { parent::EntityDataMapper(); $node_mapper = new CompositeMapper(); $node_mapper->registerMapper(new LimbHandle(LIMB_DIR . '/core/data_mappers/TreeNodeDataMapper')); $node_mapper->registerMapper(new LimbHandle(LIMB_DIR . '/core/data_mappers/NodeConnectionMapper')); $this->registerPartMapper('node', $node_mapper); $this->registerPartMapper('service', new LimbHandle(LIMB_DIR . '/core/data_mappers/ServiceLocationMapper')); $this->registerPartMapper('content', new LimbHandle(LIMB_DIR . '/core/data_mappers/OneTableObjectMapper', array($table_class_name))); }
function testDelete() { $m1 = new AbstractDataMapperForCompositeTestVersion($this); $m2 = new AbstractDataMapperForCompositeTestVersion($this); $counter = 1; $m1->setCounter($counter); $m2->setCounter($counter); $mapper = new CompositeMapper(); $mapper->registerMapper($m1); $mapper->registerMapper($m2); $m1->expectOnce('delete', array($this->object)); $m2->expectOnce('delete', array($this->object)); $mapper->delete($this->object); $this->assertEqual($m1->call_order, 1); $this->assertEqual($m2->call_order, 2); $m1->tally(); $m2->tally(); }