- Issue created by @ivnish
- Merge request !364Issue #3485574: Placed time return string but should be int → (Closed) created by ivnish
- 🇮🇱Israel jsacksick
But then we have the same problem with the created and completed timestamps right?
Ideally we'd change the return type as well, but that could break code decorating the order entity class. - 🇮🇱Israel jsacksick
hm... First of all, the value can be NULL... When the order isn't placed, with this, 0 is going to be returned, which is not the same behavior.
- ivnish Kazakhstan
Yes. You are right. Lets change interface from
/**
* Gets the order placed timestamp.
*
* @return int
* The order placed timestamp.
*/
public function getPlacedTime();to
/**
* Gets the order placed timestamp.
*
* @return string
* The order placed timestamp.
*/
public function getPlacedTime(); - 🇮🇱Israel jsacksick
No! This isn't the change I'm suggesting, the placed time returned should be an int, not a string. But what I'm saying is that we shouldn't return 0 if it's NULL.
And whatever we do, we should replicate it to other entity types / fields returning timestamps...
Note that we don't do anything different than the Node entity type defined by Drupal core here, which doesn't cast the return value... - ivnish Kazakhstan
Okay, my skills end here. I fixed my project by "(int)". Will be cool if you fix it