@@ 70-74 (lines=5) @@ | ||
67 | { |
|
68 | // prepare expiration |
|
69 | if (!empty($ttl)) { |
|
70 | if ($ttl instanceof \DateInterval) { |
|
71 | $ttl = $ttl->s; |
|
72 | } elseif (!is_int($ttl)) { |
|
73 | throw new InvalidArgumentException('Invalid TTL specified'); |
|
74 | } |
|
75 | ||
76 | $expirationTimestamp = time() + $ttl; |
|
77 | } |
|
@@ 173-177 (lines=5) @@ | ||
170 | ||
171 | // prepare expiration |
|
172 | if (!empty($ttl)) { |
|
173 | if ($ttl instanceof \DateInterval) { |
|
174 | $ttl = $ttl->s; |
|
175 | } elseif (!is_int($ttl)) { |
|
176 | throw new InvalidArgumentException('Invalid TTL specified'); |
|
177 | } |
|
178 | ||
179 | $expirationTimestamp = time() + $ttl; |
|
180 | $document[self::FIELD_NAME_EXPIRED] = new \MongoDate((int) $expirationTimestamp); |