[FLOW3-general] Problems persisting DateTime object

Zachary Davis, Cast Iron Coding LLC zach at castironcoding.com
Mon Jun 7 06:39:47 CEST 2010


So, I got this to work after manually clearing the files in 
Data/Temporary. It seems that for some reason when I added this property 
to the Account object, the change didn't get automatically picked up in 
the same way that other changes do. Not sure if this points to a bug or not.

best,
Zach



Zachary Davis, Cast Iron Coding LLC wrote:
> I suspect I'm overlooking something and that this is a stupid mistake, 
> but I'm stuck :)
> 
> I have an object "Account" that has a creationDate property:
> 
> /**
>  * The account creation date
>  *
>  * @var \DateTime
>  */
> protected $creationDate;
> 
> I'm setting the creation date in the constructo (copying what Robert 
> does on posts in the blog package)
> 
> /**
>  * The account constructor.
>  */
> public function __construct() {
>     $this->creationDate = new \DateTime();
> }
> 
> I've also tried setting this with a setter method:
> 
> 
> I'm able to persist this Account object successfully and other fields 
> show up on it. However, whenever I debug it using \F3\var_dump it always 
> shows a "NULL" value for the creationDate property. I thought it might 
> be a shortcoming in var_dump, so I've also tried accessing the 
> creationDate via a get method and running whats returned through 
> print_r, but that doesn't give me anything either.
> 
> I'm probably forgetting to do something obvious, but I'm not sure what 
> it is or where to look to figure out why it's not getting set.
> 
> best,
> Zach


More information about the FLOW3-general mailing list