Impossible to use MySQL's non-NULL Datetime #103

Closed
coviex opened this Issue Jan 6, 2012 · 1 comment

Comments

Projects
None yet
2 participants
@coviex

coviex commented Jan 6, 2012

Hi,

MySQL table has:

`done_at` datetime NOT NULL

AFAIK in Propel Datetime maps to timestamp.
So schema.yml has:

done_at: { type: timestamp }

Result is:

  DateTime::__construct(): Failed to parse time string (0) at position 0 (0): Unexpected character 

when I try to setDoneAt() on model with empty ('0000-00-00 00:00:00') property.
Error seems to be in setDoneAt() in line:

$currentDateAsString = ($this->checked_at !== null && $tmpDt = new DateTime($this->checked_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;

Cheers

@willdurand

This comment has been minimized.

Show comment Hide comment
@willdurand

willdurand Jan 7, 2012

Member

Seems close to Propel. You should open this issue in the Propel repository itself.

Member

willdurand commented Jan 7, 2012

Seems close to Propel. You should open this issue in the Propel repository itself.

@willdurand willdurand closed this Jan 7, 2012

hd-deman pushed a commit to hd-deman/sfPropelORMPlugin that referenced this issue May 4, 2012

Merge pull request #103 from willdurand/setter-collections
Added setter for collections (N-N relations)

hd-deman pushed a commit to hd-deman/sfPropelORMPlugin that referenced this issue May 4, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment