if ($fkDAO->find(TRUE)) {
$this->$dbName = $fkDAO->id;
}
- unset($fkDAO);
+ $fkDAO->free();
}
elseif (in_array($FKClassName, CRM_Core_DAO::$_testEntitiesToSkip)) {
$depObject = new $FKClassName();
$depObject->find(TRUE);
$this->$dbName = $depObject->id;
- unset($depObject);
+ $depObject->free();
}
elseif ($daoName == 'CRM_Member_DAO_MembershipType' && $fieldName == 'member_of_contact_id') {
// FIXME: the fields() metadata is not specific enough
$depObject = CRM_Core_DAO::createTestObject($FKClassName, array('contact_type' => 'Organization'));
$this->$dbName = $depObject->id;
- unset($depObject);
+ $depObject->free();
}
else {
//if it is required we need to generate the dependency object first
$depObject = CRM_Core_DAO::createTestObject($FKClassName, CRM_Utils_Array::value($dbName, $params, 1));
$this->$dbName = $depObject->id;
- unset($depObject);
+ $depObject->free();
}
}
$event = new \Civi\Core\DAO\Event\PostDelete($this, $result);
\Civi\Core\Container::singleton()->get('dispatcher')->dispatch("DAO::post-delete", $event);
+ $this->free();
return $result;
}
for ($i = 0; $i < 30; $i++) {
$baoObj = CRM_Core_DAO::createTestObject($baoString, array('currency' => 'USD'));
$ids[] = $baoObj->id;
+ $baoObj->free();
}
// each case is array(0 => $inputtedApiOptions, 1 => $expectedResultCount)
for ($i = 0; $i < 3 - $totalEntities; $i++) {
$baoObj = CRM_Core_DAO::createTestObject($baoString, array('currency' => 'USD'));
$ids[] = $baoObj->id;
+ $baoObj->free();
}
$totalEntities = 3;
}