{"id":15172668,"url":"https://github.com/strakers/drupal-entity-decorator","last_synced_at":"2026-01-24T20:54:56.173Z","repository":{"id":211471009,"uuid":"729251693","full_name":"strakers/drupal-entity-decorator","owner":"strakers","description":"Implements a decorator pattern to access and customize an entity's properties and methods, with the option to strongly type return values.","archived":false,"fork":false,"pushed_at":"2024-02-08T23:03:55.000Z","size":241,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-19T23:07:43.657Z","etag":null,"topics":["drupal","entity","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/strakers.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-08T18:12:20.000Z","updated_at":"2024-01-19T20:57:14.000Z","dependencies_parsed_at":"2023-12-08T19:33:22.104Z","dependency_job_id":"459d3dbf-0249-4fc4-81bf-bb54b45ff35a","html_url":"https://github.com/strakers/drupal-entity-decorator","commit_stats":{"total_commits":107,"total_committers":2,"mean_commits":53.5,"dds":0.01869158878504673,"last_synced_commit":"d8db348d3fbd237c7493d8a45bc5f200dd88f29d"},"previous_names":["strakers/drupal-entity-decorator"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/strakers/drupal-entity-decorator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strakers%2Fdrupal-entity-decorator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strakers%2Fdrupal-entity-decorator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strakers%2Fdrupal-entity-decorator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strakers%2Fdrupal-entity-decorator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strakers","download_url":"https://codeload.github.com/strakers/drupal-entity-decorator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strakers%2Fdrupal-entity-decorator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28736791,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T19:23:36.361Z","status":"ssl_error","status_checked_at":"2026-01-24T19:23:28.966Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drupal","entity","php"],"created_at":"2024-09-27T10:02:25.366Z","updated_at":"2026-01-24T20:54:56.152Z","avatar_url":"https://github.com/strakers.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Drupal Entity Decorator API\n\nImplements a decorator pattern to access and customize an entity's properties and methods, with the option to strongly\ntype return values.\n\n---\n\n## Installation\n\n```bash\ncomposer require strakez/drupal-entity-decorator\n```\n\n---\n\n## Requirements\n\n- PHP 8.1+\n- Drupal 10+\n\n---\n\n## Purpose\n\nProvides a simple means to retrieve and display entity data, and solves some of the challenges experienced when working\nwith entities. This implementation of the decorator pattern wraps the entity and provides customized methods for\ninteracting with the entity.\n\nPlease note, this only exposes classes for use in other modules and does not provide any Drupal functionality on its own.\nThere will not be anything to display via the UI unless specifically implemented.\n\n---\n\n## Usage\n\n```php\n$id = 1;\n$node = NodeDecorator::load($id); // Collection\n\n$node-\u003eid(); // 1\n$node-\u003eget('title'); // 'My First Node'\n$node-\u003eget('sticky'); // false\n```\n\nFor information on using and extending decorators, see the [Decorator documentation](docs/Decorators.md).\n\nFor tips and best practices, see the [Tips \u0026 Best Practices](docs/BestPractices.md) section.\n\n---\n\n## Working with Collections\n\nWhen loading multiple decorators at a time, the data will be representated in a collection. This provides an advantage\nover simple arrays, as this data can be easily sorted, mutated, counted, and indexed.\n\n```php\n$set = NodeDecorator::loadByOwned($user); // Collection\n```\n\nFor more information, see the [Collection documentation](docs/Collections.md).\n\n## Final Words\n\nPlease have fun using this API, and feel free to submit your comments and/or improvements if you find any. Thanks!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrakers%2Fdrupal-entity-decorator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrakers%2Fdrupal-entity-decorator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrakers%2Fdrupal-entity-decorator/lists"}