我有我的symfony原則和其他實體正在處理這個,因爲他們應該但其中一個不設置任何日期的教條時間戳集。主義時間戳戳擴展不支持
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Digital\UserBundle\Entity\User;
/**
* ChallengeScore
*
* @ORM\Table(name="app_challenges_scores")
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="type", type="string")
* @ORM\DiscriminatorMap({"race" = "Digital\ApplicationBundle\Entity\Race\ChallengeScore", "individual" = "ChallengeScore"})
* @ORM\Entity(repositoryClass="Digital\ApplicationBundle\EntityRepository\ChallengeScoreRepository")
*/
class ChallengeScore
/**
* @var \DateTime
*
* @ORM\Column(name="date_added", type="datetime")
* @Gedmo\Timestampable(on="create")
*/
private $date_added;
/**
* @var \DateTime
*
* @ORM\Column(name="date_modified", type="datetime")
* @Gedmo\Timestampable(on="update")
*/
private $date_modified;
/**
* Set date_added
*
* @param \DateTime $dateAdded
*
* @return self
*/
public function setDateAdded($dateAdded)
{
$this->date_added = $dateAdded;
return $this;
}
/**
* Get date_added
*
* @return \DateTime
*/
public function getDateAdded()
{
return $this->date_added;
}
/**
* Set date_modified
*
* @param \DateTime $dateModified
*
* @return self
*/
public function setDateModified($dateModified)
{
$this->date_modified = $dateModified;
return $this;
}
/**
* Get date_modified
*
* @return \DateTime
*/
public function getDateModified()
{
return $this->date_modified;
}
}
我在想也許這個配置有繼承定義的問題......任何人都可以發現問題嗎?
沒有錯誤只是00000保存到數據庫(所以沒什麼)
我會推薦你在你的setter方法var_dump你的日期,並確保它正在代謝正確 – Lighthart 2013-04-23 23:55:59