Skip to content

Instantly share code, notes, and snippets.

@DominikStyp
Last active June 13, 2022 18:47
Show Gist options
  • Save DominikStyp/25c7d6b61708603cce680115c092bbfb to your computer and use it in GitHub Desktop.
Save DominikStyp/25c7d6b61708603cce680115c092bbfb to your computer and use it in GitHub Desktop.
PHPStorm + Deep Assoc Complete
<?php
class MyRepository {
/**
*
*
* @param $filter = [
* "id" => "uuid",
* "version" => "2022-02-03 12:11:00",
* "name" => "some document name",
* "access_level" => [
* \App\Enums\DocumentAccessLevelEnum::INVESTOR,
* \App\Enums\DocumentAccessLevelEnum::FUND_MANAGER,
* \App\Enums\DocumentAccessLevelEnum::INVESTOR_ACCOUNT,
* ][$any],
* "privacy_level" => [
* \App\Enums\DocumentPrivacyLevelEnum::LOW,
* \App\Enums\DocumentPrivacyLevelEnum::MEDIUM_LOW,
* \App\Enums\DocumentPrivacyLevelEnum::MEDIUM,
* \App\Enums\DocumentPrivacyLevelEnum::MEDIUM_HIGH,
* \App\Enums\DocumentPrivacyLevelEnum::HIGH,
* ][$any],
* "creation_time" => "Y-m-d H:i:s",
* ]
*
* @return Document[]|Collection<Document>
*
*/
public function all(
array $filter = []
): Collection {
$builder = $this->newQueryBuilder($filter);
return $this->resource->all($builder);
}
}
<?php
// IMPORTANT! We get autocompletion only inside the string quotes (or double quotes) where the dots are
$obj = new MyRepository();
$obj->all([
'....' => '.....'
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment