From 74d1874991c1bde7eed7c0695e62647607664857 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Sat, 14 Aug 2021 19:41:22 +0000 Subject: [PATCH] [DOCUMENTATION][Entity] Improve documentation on Entity::getWithPK, explaining the ways it can be used --- src/Core/Entity.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Core/Entity.php b/src/Core/Entity.php index 899310faad..7519c9b428 100644 --- a/src/Core/Entity.php +++ b/src/Core/Entity.php @@ -99,7 +99,15 @@ abstract class Entity implements \JsonSerializable /** * Get an Entity from its primary key * - * @param int $id + * Support multiple formats: + * - mixed $values - convert to array and check next + * - array[int => mixed] $values - get keys for entity and set them in order and proceed to next case + * - array[string => mixed] $values - Perform a regular find + * + * Examples: + * Entity::getWithPK(42); + * Entity::getWithPK([42, 'foo']); + * Entity::getWithPK(['key1' => 42, 'key2' => 'foo']) * * @return null|static */