Skip to content

Commit

Permalink
retrieve meta
Browse files Browse the repository at this point in the history
  • Loading branch information
asika32764 committed Jan 25, 2024
1 parent 7c00a53 commit 8d99d48
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/orm/src/EntityTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Windwalker\ORM;

use Asika\ObjectMetadata\ObjectMetadata;
use ReflectionAttribute;
use ReflectionClass;
use ReflectionProperty;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 8d99d48

Please sign in to comment.