diff --git a/src/Field/BasicField.php b/src/Field/BasicField.php index 5b39971..bae10ae 100644 --- a/src/Field/BasicField.php +++ b/src/Field/BasicField.php @@ -7,6 +7,8 @@ use Corcel\Model\Meta\PostMeta; use Corcel\Model\Term; use Corcel\Model\Meta\TermMeta; +use Corcel\Model\User; +use Corcel\Model\Meta\UserMeta; /** * Class BasicField. @@ -63,6 +65,8 @@ public function __construct(Model $post) $this->postMeta = new PostMeta(); } elseif ($post instanceof Term) { $this->postMeta = new TermMeta(); + } elseif ($post instanceof User) { + $this->postMeta = new UserMeta(); } $this->postMeta->setConnection($post->getConnectionName()); @@ -151,6 +155,8 @@ public function getKeyName() return 'post_id'; } elseif ($this->post instanceof Term) { return 'term_id'; + } elseif ($this->post instanceof User) { + return 'user_id'; } }