/** * Creates a new reference in the old datasource. * * Involves creating an Enquiry record and a corresponding progress record. * * @return Model_Referencing_Reference * A minimal Reference object encapsulating internal and external identifiers * only, corresponding to the new record inserted in the legacy datasources. */ public function createReference() { // Create an Enquiry record in the legacy datasource, then pull the identifiers // from this into the new datasource. $legacyEnquiryDatasource = new Datasource_ReferencingLegacy_Enquiry(); $reference = $legacyEnquiryDatasource->createNewEnquiry(); //Insert a progress record to pair with the Enquiry. $progressDatasource = new Datasource_ReferencingLegacy_Progress(); $progressDatasource->createNewProgress((string) $reference->externalId); return $reference; }