API CHANGE: NOW() replaced with DB-specific version

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@72922 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Geoff Munn 2009-03-11 21:50:03 +00:00
parent cac97f9d78
commit 807736490f
3 changed files with 3 additions and 4 deletions

View File

@ -13,7 +13,7 @@ class QueuedEmailDispatchTask extends DailyTask {
echo "SENDING QUEUED EMAILS\n"; echo "SENDING QUEUED EMAILS\n";
$queued = DataObject::get('QueuedEmail', "\"Send\" < NOW()"); $queued = DataObject::get('QueuedEmail', "\"Send\" < " . DB::getConn()->now());
if( !$queued ) if( !$queued )
return; return;

View File

@ -156,7 +156,7 @@ class Folder extends File {
DB::query("INSERT INTO \"File\" DB::query("INSERT INTO \"File\"
(\"ClassName\", \"ParentID\", \"OwnerID\", \"Name\", \"Filename\", \"Created\", \"LastEdited\", \"Title\") (\"ClassName\", \"ParentID\", \"OwnerID\", \"Name\", \"Filename\", \"Created\", \"LastEdited\", \"Title\")
VALUES ('$className', $this->ID, $ownerID, '$name', '$filename', NOW(), NOW(), '$name')"); VALUES ('$className', $this->ID, $ownerID, '$name', '$filename', " . DB::getConn()->now() . ',' . DB::getConn()->now() . ", '$name')");
return DB::getGeneratedID("File"); return DB::getGeneratedID("File");
} }

View File

@ -325,8 +325,7 @@ class Member extends DataObject {
static function member_from_autologinhash($RAW_hash, $login = false) { static function member_from_autologinhash($RAW_hash, $login = false) {
$SQL_hash = Convert::raw2sql($RAW_hash); $SQL_hash = Convert::raw2sql($RAW_hash);
$member = DataObject::get_one('Member',"\"AutoLoginHash\"='" . $SQL_hash . $member = DataObject::get_one('Member',"\"AutoLoginHash\"='" . $SQL_hash . "' AND \"AutoLoginExpired\" > " . DB::getConn()->now());
"' AND \"AutoLoginExpired\" > NOW()");
if($login && $member) if($login && $member)
$member->logIn(); $member->logIn();