[FLOW3-general] Problems persisting DateTime object

Zachary Davis, Cast Iron Coding LLC zach at castironcoding.com
Sun Jun 6 22:27:11 CEST 2010


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