Skip to content

Commit

Permalink
Merge pull request #52 from blueoceanideas/master
Browse files Browse the repository at this point in the history
Add support for acf fields on users
  • Loading branch information
jgrossi authored Oct 4, 2017
2 parents a8ee2f9 + e598b46 commit f58003a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Field/BasicField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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';
}
}

Expand Down

0 comments on commit f58003a

Please sign in to comment.