From 8d99d4864523388976858d525f22977267f7cf03 Mon Sep 17 00:00:00 2001 From: Simon Asika Date: Thu, 25 Jan 2024 12:46:26 +0800 Subject: [PATCH] retrieve meta --- packages/orm/src/EntityTrait.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/orm/src/EntityTrait.php b/packages/orm/src/EntityTrait.php index 80bb37182..6817181f7 100644 --- a/packages/orm/src/EntityTrait.php +++ b/packages/orm/src/EntityTrait.php @@ -4,6 +4,7 @@ namespace Windwalker\ORM; +use Asika\ObjectMetadata\ObjectMetadata; use ReflectionAttribute; use ReflectionClass; use ReflectionProperty; @@ -41,6 +42,11 @@ public static function newInstance(array $data = []): static return $instance; } + protected function retrieveMeta(string $key): mixed + { + return EntityMapper::getObjectMetadata()->get($this, $key); + } + protected function loadRelation(string $propName): mixed { return $this->$propName ??= RelationProxies::call($this, $propName);