# HG changeset patch # User ymh # Date 1323409429 -3600 # Node ID 10be6b9e55e760b9f2dc4179990a098169612002 # Parent 1bc0ec8ed05b5c1d72ef15eac1fc08044db7679c add creation timestamp on document tag and document tag diff -r 1bc0ec8ed05b -r 10be6b9e55e7 Model/Document.php --- a/Model/Document.php Fri Dec 09 04:53:56 2011 +0100 +++ b/Model/Document.php Fri Dec 09 06:43:49 2011 +0100 @@ -20,7 +20,6 @@ */ protected $id; - /** * @var boolean $manualOrder */ @@ -40,6 +39,11 @@ * @var string tagsStr */ protected $tagsStr; + + /** + * @var DateTime + */ + protected $createdAt; /** @@ -118,6 +122,25 @@ return $this->tagsStr; } + /** + * (non-PHPdoc) + * @see IRI\Bundle\WikiTagBundle\Model.DocumentInterface::getCreatedAt() + */ + function getCreatedAt() + { + return $this->createdAt; + } + + /** + * + * construct the class + */ + function __construct() + { + $this->createdAt = new \DateTime("now", new \DateTimeZone('UTC')); + } + + public function __toString() { return print_r(Debug::export($this, 3),true); diff -r 1bc0ec8ed05b -r 10be6b9e55e7 Model/DocumentInterface.php --- a/Model/DocumentInterface.php Fri Dec 09 04:53:56 2011 +0100 +++ b/Model/DocumentInterface.php Fri Dec 09 06:43:49 2011 +0100 @@ -70,5 +70,11 @@ * @param $tagsStr */ function setTagsStr($tagsStr); + + /** + * return the utc time when this object has been created + */ + function getCreatedAt(); + } diff -r 1bc0ec8ed05b -r 10be6b9e55e7 Model/DocumentTag.php --- a/Model/DocumentTag.php Fri Dec 09 04:53:56 2011 +0100 +++ b/Model/DocumentTag.php Fri Dec 09 06:43:49 2011 +0100 @@ -48,6 +48,21 @@ protected $document; + /** + * @var DateTime + */ + protected $createdAt; + + /** + * + * construct the class + */ + function __construct() + { + $this->createdAt = new \DateTime("now", new \DateTimeZone('UTC')); + } + + /** * Get id * @@ -178,6 +193,16 @@ return $this->document; } + /** + * (non-PHPdoc) + * @see IRI\Bundle\WikiTagBundle\Model.DocumentTagInterface::getCreatedAt() + */ + function getCreatedAt() + { + return $this->createdAt; + } + + /** * Get wikipedia_version_permalink * diff -r 1bc0ec8ed05b -r 10be6b9e55e7 Model/DocumentTagInterface.php --- a/Model/DocumentTagInterface.php Fri Dec 09 04:53:56 2011 +0100 +++ b/Model/DocumentTagInterface.php Fri Dec 09 06:43:49 2011 +0100 @@ -103,5 +103,11 @@ */ function getDocument(); + /** + * return the utc time when this object has been created + */ + function getCreatedAt(); + + } \ No newline at end of file diff -r 1bc0ec8ed05b -r 10be6b9e55e7 Model/Tag.php --- a/Model/Tag.php Fri Dec 09 04:53:56 2011 +0100 +++ b/Model/Tag.php Fri Dec 09 06:43:49 2011 +0100 @@ -56,8 +56,7 @@ * @var string $alternativeWikipediaUrl */ protected $alternativeWikipediaUrl; - - + /** * @var bigint $wikipediaPageId */ @@ -92,9 +91,23 @@ * @var ArrayCollection $documents */ protected $documents; + + /** + * @var DateTime + */ + protected $createdAt; /** + * + * construct the class + */ + function __construct() + { + $this->createdAt = new \DateTime("now", new \DateTimeZone('UTC')); + } + + /** * Get id * * @return integer @@ -397,6 +410,15 @@ { return $this->category; } + + /** + * (non-PHPdoc) + * @see IRI\Bundle\WikiTagBundle\Model.TagInterface::getCreatedAt() + */ + function getCreatedAt() + { + return $this->createdAt; + } /** * Get Documents diff -r 1bc0ec8ed05b -r 10be6b9e55e7 Model/TagInterface.php --- a/Model/TagInterface.php Fri Dec 09 04:53:56 2011 +0100 +++ b/Model/TagInterface.php Fri Dec 09 06:43:49 2011 +0100 @@ -218,6 +218,11 @@ function getCategory(); /** + * return the utc time when this tag has been created + */ + function getCreatedAt(); + + /** * Get Documents * * @return ArrayCollection @@ -236,5 +241,6 @@ * @param $wikipedia_info */ function setWikipediaInfo($wikipedia_info); + } \ No newline at end of file diff -r 1bc0ec8ed05b -r 10be6b9e55e7 Resources/config/doctrine/Document.orm.yml --- a/Resources/config/doctrine/Document.orm.yml Fri Dec 09 04:53:56 2011 +0100 +++ b/Resources/config/doctrine/Document.orm.yml Fri Dec 09 06:43:49 2011 +0100 @@ -14,9 +14,13 @@ type: boolean column: manual_order tagsStr: - type: text - column: tags_str - nullable: true + type: text + column: tags_str + nullable: true + createdAt: + type: datetime + column: created_at + nullable: false oneToMany: tags: targetEntity: DocumentTag diff -r 1bc0ec8ed05b -r 10be6b9e55e7 Resources/config/doctrine/DocumentTag.orm.yml --- a/Resources/config/doctrine/DocumentTag.orm.yml Fri Dec 09 04:53:56 2011 +0100 +++ b/Resources/config/doctrine/DocumentTag.orm.yml Fri Dec 09 06:43:49 2011 +0100 @@ -21,6 +21,10 @@ type: bigint column: wikipedia_revision_id nullable: true + createdAt: + type: datetime + column: created_at + nullable: false manyToOne: tag: targetEntity: Tag diff -r 1bc0ec8ed05b -r 10be6b9e55e7 Resources/config/doctrine/Tag.orm.yml --- a/Resources/config/doctrine/Tag.orm.yml Fri Dec 09 04:53:56 2011 +0100 +++ b/Resources/config/doctrine/Tag.orm.yml Fri Dec 09 06:43:49 2011 +0100 @@ -57,6 +57,11 @@ nullable: true popularity: type: integer + createdAt: + type: datetime + column: created_at + nullable: false + manyToOne: category: targetEntity: Category diff -r 1bc0ec8ed05b -r 10be6b9e55e7 Resources/public/images/arrow_refresh.png Binary file Resources/public/images/arrow_refresh.png has changed