1: <?php
2:
3: namespace Charcoal\Object;
4:
5: // Dependency from 'charcoal-core'
6: use Charcoal\Model\ModelInterface;
7:
8: /**
9: * Defines a model for objects typically submitted by the end-user of the application.
10: *
11: * @see UserData for basic implementation of interface.
12: */
13: interface UserDataInterface extends ModelInterface
14: {
15: /**
16: * Set the client IP address.
17: *
18: * @param integer|null $ip The remote IP at object creation.
19: * @return UserDataInterface Chainable
20: */
21: public function setIp($ip);
22:
23: /**
24: * Retrieve the client IP address.
25: *
26: * @return integer|null
27: */
28: public function ip();
29:
30: /**
31: * Set the origin language.
32: *
33: * @param string $lang The language code.
34: * @return UserDataInterface Chainable
35: */
36: public function setLang($lang);
37:
38: /**
39: * Retrieve the language.
40: *
41: * @return string
42: */
43: public function lang();
44:
45: /**
46: * Set the origin of the object submission.
47: *
48: * @param string $origin The source URL or identifier of the submission.
49: * @return UserDataInterface Chainable
50: */
51: public function setOrigin($origin);
52:
53: /**
54: * Retrieve the origin of the object submission.
55: *
56: * @return string
57: */
58: public function origin();
59:
60: /**
61: * Set when the object was created.
62: *
63: * @param \DateTime|string|null $timestamp The timestamp at object's creation.
64: * @return UserDataInterface Chainable
65: */
66: public function setTs($timestamp);
67:
68: /**
69: * Retrieve the creation timestamp.
70: *
71: * @return \DateTime|null
72: */
73: public function ts();
74: }
75: