Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

coviex opened this issue Jan 6, 2012 · 1 comment

Comments

@coviex
Copy link

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
Copy link
Contributor

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

hd-deman pushed a commit to hd-deman/sfPropelORMPlugin that referenced this issue May 4, 2012
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants