select('testmapdetail.*, containerdef.ConName AS ContainerLabel') ->join('containerdef', 'containerdef.ConDefID = testmapdetail.ConDefID', 'left') ->where('testmapdetail.TestMapID', $testMapID) ->where('testmapdetail.EndDate IS NULL') ->findAll(); } /** * Get test map detail by host test code */ public function getDetailsByHostCode($hostTestCode) { return $this->where('HostTestCode', $hostTestCode) ->where('EndDate IS NULL') ->findAll(); } /** * Get test map detail by client test code */ public function getDetailsByClientCode($clientTestCode) { return $this->where('ClientTestCode', $clientTestCode) ->where('EndDate IS NULL') ->findAll(); } /** * Disable all details for a test map * * @param int $testMapID * @return void */ public function disableByTestMapID($testMapID) { $this->where('TestMapID', $testMapID) ->where('EndDate', null) ->set('EndDate', date('Y-m-d H:i:s')) ->update(); } }