namespace Shaarli\Bookmark;
use DateTime;
+use DateTimeInterface;
use Shaarli\Bookmark\Exception\InvalidBookmarkException;
/**
/** @var bool Set to true if the bookmark is set as sticky */
protected $sticky;
- /** @var DateTime Creation datetime */
+ /** @var DateTimeInterface Creation datetime */
protected $created;
- /** @var DateTime Update datetime */
+ /** @var DateTimeInterface datetime */
protected $updated;
/** @var bool True if the bookmark can only be seen while logged in */
|| ! is_int($this->id)
|| empty($this->shortUrl)
|| empty($this->created)
- || ! $this->created instanceof DateTime
+ || ! $this->created instanceof DateTimeInterface
) {
throw new InvalidBookmarkException($this);
}
/**
* Get the Created.
*
- * @return DateTime
+ * @return DateTimeInterface
*/
public function getCreated()
{
/**
* Get the Updated.
*
- * @return DateTime
+ * @return DateTimeInterface
*/
public function getUpdated()
{
* Set the Created.
* Note: you shouldn't set this manually except for special cases (like bookmark import)
*
- * @param DateTime $created
+ * @param DateTimeInterface $created
*
* @return Bookmark
*/
/**
* Set the Updated.
*
- * @param DateTime $updated
+ * @param DateTimeInterface $updated
*
* @return Bookmark
*/