[DOCUMENTATION][Entity] Improve documentation on Entity::getWithPK, explaining the ways it can be used

This commit is contained in:
Hugo Sales 2021-08-14 19:41:22 +00:00
parent 2e3ab5bdfb
commit f3972abb70
Signed by untrusted user: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -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
*/