3 namespace Wallabag\CoreBundle\Entity
;
5 use Doctrine\ORM\Mapping
as ORM
;
6 use Wallabag\FederationBundle\Entity\Account
;
11 * This entity stores a datetime for each activity.
13 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\ChangeRepository")
14 * @ORM\Table(name="`activity`")
21 const ENTRY_OBJECT
= 1;
23 const USER_OBJECT
= 3;
24 const SHARE_OBJECT
= 4;
25 const GROUP_OBJECT
= 5;
26 const ANNOTATION_OBJECT
= 6;
27 const CONFIG_OBJECT
= 7;
28 const ACCOUNT_OBJECT
= 8;
37 const ENTRY_ADD
= 10; // done
38 const ENTRY_EDIT
= 11; // done
39 const ENTRY_READ
= 12; // done
40 const ENTRY_UNREAD
= 13; // done
41 const ENTRY_FAVOURITE
= 14; // done
42 const ENTRY_UNFAVOURITE
= 15; // done
43 const ENTRY_DELETE
= 19; // done
48 const TAG_CREATE
= 20; // not yet implemented
49 const TAG_EDIT
= 21; // not yet implemented
50 const TAG_REMOVE
= 29; // not yet implemented
55 const ENTRY_ADD_TAG
= 30; // done
56 const ENTRY_REMOVE_TAG
= 39; // done
59 * Entry - Annotation events
61 const ANNOTATION_ADD
= 40; // done
62 const ANNOTATION_EDIT
= 41; // done
63 const ANNOTATION_REMOVE
= 49; // done
68 const USER_CREATE
= 50; // done
69 const USER_EDIT
= 51; // done
70 const USER_REMOVE
= 59; // done
75 const FOLLOW_ACCOUNT
= 61;
76 const UNFOLLOW_ACCOUNT
= 62;
77 const RECOMMEND_ENTRY
= 63;
82 const USER_SHARE_CREATED
= 70; // done
83 const USER_SHARE_ACCEPTED
= 71; // done
84 const USER_SHARE_REFUSED
= 72; // done
85 const USER_SHARE_CANCELLED
= 79; // not implemented yet
90 const GROUP_CREATE
= 80;
91 const GROUP_EDIT
= 81;
92 const GROUP_ADD_MEMBER
= 82;
93 const GROUP_EDIT_MEMBER
= 83;
94 const GROUP_REMOVE_MEMBER
= 84;
95 const GROUP_SHARE_ENTRY
= 85;
96 const GROUP_DELETE
= 89;
101 * @ORM\Column(type="integer")
103 * @ORM\GeneratedValue(strategy="AUTO")
110 * @ORM\Column(type="integer")
112 private $activityType;
122 * @ORM\Column(type="integer")
124 private $primaryObjectType;
129 * @ORM\Column(type="integer")
131 private $primaryObjectId;
136 * @ORM\Column(type="integer", nullable=true)
138 private $secondaryObjectType;
143 * @ORM\Column(type="integer", nullable=true)
145 private $secondaryObjectId;
150 * @ORM\Column(name="created_at", type="datetime")
154 public function __construct($activityType, $primaryObjectType, $primaryObjectId)
156 $this->activityType
= $activityType;
157 $this->primaryObjectType
= $primaryObjectType;
158 $this->primaryObjectId
= $primaryObjectId;
159 $this->createdAt
= new \
DateTime();
165 public function getId()
173 public function getActivityType()
175 return $this->activityType
;
179 * @param int $activityType
182 public function setActivityType($activityType)
184 $this->activityType
= $activityType;
191 public function getCreatedAt()
193 return $this->createdAt
;
197 * @param \DateTime $createdAt
200 public function setCreatedAt(\DateTime
$createdAt)
202 $this->createdAt
= $createdAt;
209 public function getPrimaryObjectId()
211 return $this->primaryObjectId
;
215 * @param $primaryObjectId
218 public function setPrimaryObjectId($primaryObjectId)
220 $this->primaryObjectId
= $primaryObjectId;
227 public function getUser()
233 * @param Account $user
236 public function setUser($user)
245 public function getPrimaryObjectType()
247 return $this->primaryObjectType
;
251 * @param int $primaryObjectType
254 public function setPrimaryObjectType($primaryObjectType)
256 $this->primaryObjectType
= $primaryObjectType;
263 public function getSecondaryObjectType()
265 return $this->secondaryObjectType
;
269 * @param int $secondaryObjectType
272 public function setSecondaryObjectType($secondaryObjectType)
274 $this->secondaryObjectType
= $secondaryObjectType;
281 public function getSecondaryObjectId()
283 return $this->secondaryObjectId
;
287 * @param int $secondaryObjectId
290 public function setSecondaryObjectId($secondaryObjectId)
292 $this->secondaryObjectId
= $secondaryObjectId;