break;
case CRM_Utils_Type::T_DATE:
- case CRM_Utils_Type::T_TIMESTAMP:
case CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME:
$this->$dbName = '19700101';
if ($dbName == 'end_date') {
}
break;
+ case CRM_Utils_Type::T_TIMESTAMP:
+ $this->$dbName = '19700201000000';
+ break;
+
case CRM_Utils_Type::T_TIME:
CRM_Core_Error::fatal("T_TIME shouldn't be used.");
//$object->$dbName='000000';
// rewrite queries that should use $dbLocale-based views for multi-language installs
global $dbLocale, $_DB_DATAOBJECT;
+ if (empty($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5])) {
+ // Will force connection to be populated per CRM-20541.
+ new CRM_Core_DAO();
+ }
+
$conn = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
$orig_options = $conn->options;
$this->_setDBOptions($this->_options);
* * @return mixed Int (No. of rows affected) on success, false on failure, 0 on no data affected
*/
public function delete($useWhere = FALSE) {
+ $preEvent = new \Civi\Core\DAO\Event\PreDelete($this);
+ \Civi::service('dispatcher')->dispatch("civi.dao.preDelete", $preEvent);
+
$result = parent::delete($useWhere);
$event = new \Civi\Core\DAO\Event\PostDelete($this, $result);
public static function buildOptions($fieldName, $context = NULL, $props = array()) {
// If a given bao does not override this function
$baoName = get_called_class();
- return CRM_Core_PseudoConstant::get($baoName, $fieldName, array(), $context);
+ return CRM_Core_PseudoConstant::get($baoName, $fieldName, $props, $context);
}
/**