123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- <?php
- namespace Timestampable\Fixture\Document;
- use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
- use Gedmo\Mapping\Annotation as Gedmo;
- /**
- * @ODM\Document(collection="articles")
- */
- class Article
- {
- /** @ODM\Id */
- private $id;
- /**
- * @ODM\String
- */
- private $title;
- /**
- * @ODM\ReferenceOne(targetDocument="Type")
- */
- private $type;
- /**
- * @var timestamp $created
- *
- * @ODM\Timestamp
- * @Gedmo\Timestampable(on="create")
- */
- private $created;
- /**
- * @var date $updated
- *
- * @ODM\Date
- * @Gedmo\Timestampable
- */
- private $updated;
- /**
- * @var date $published
- *
- * @ODM\Date
- * @Gedmo\Timestampable(on="change", field="type.title", value="Published")
- */
- private $published;
- /**
- * @var \DateTime
- * @ODM\Date
- * @Gedmo\Timestampable(on="change", field="isReady", value=true)
- */
- private $ready;
- /**
- * @var bool
- * @ODM\Boolean
- */
- private $isReady = false;
- public function getId()
- {
- return $this->id;
- }
- public function setTitle($title)
- {
- $this->title = $title;
- }
- public function getTitle()
- {
- return $this->title;
- }
- public function getCreated()
- {
- return $this->created;
- }
- public function getPublished()
- {
- return $this->published;
- }
- public function getUpdated()
- {
- return $this->updated;
- }
- public function setType(Type $type)
- {
- $this->type = $type;
- }
- public function getType()
- {
- return $this->type;
- }
- public function setCreated($created)
- {
- $this->created = $created;
- }
- public function setPublished(\DateTime $published)
- {
- $this->published = $published;
- }
- public function setUpdated(\DateTime $updated)
- {
- $this->updated = $updated;
- }
- public function setReady($ready)
- {
- $this->ready = $ready;
- return $this;
- }
- public function getReady()
- {
- return $this->ready;
- }
- public function setIsReady($isReady)
- {
- $this->isReady = $isReady;
- return $this;
- }
- public function getIsReady()
- {
- return $this->isReady;
- }
- }
|