Collaboration.php
1 month ago
CollaborationComment.php
1 month ago
CollaborationCommentSeen.php
1 month ago
CollaborationConnected.php
1 month ago
CollaborationSent.php
1 month ago
Collection.php
5 days ago
CollectionItem.php
1 month ago
Form.php
5 days ago
FormData.php
5 days ago
Media.php
1 month ago
Page.php
5 days ago
Post.php
1 month ago
PostMeta.php
2 weeks ago
Reference.php
1 month ago
Term.php
1 month ago
TermMeta.php
1 month ago
TermTaxonomy.php
1 month ago
User.php
1 month ago
UserMeta.php
1 month ago
User.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Kirki\App\Models; |
| 4 | |
| 5 | defined('ABSPATH') || exit; |
| 6 | |
| 7 | use Kirki\App\Models\UserMeta as UserMetaModel; |
| 8 | use Kirki\App\Traits\SearchableUser; |
| 9 | use Kirki\Framework\Database\Query\Model; |
| 10 | |
| 11 | class User extends Model |
| 12 | { |
| 13 | use SearchableUser; |
| 14 | |
| 15 | protected $table = 'users'; |
| 16 | |
| 17 | protected $primary_key = 'ID'; |
| 18 | |
| 19 | protected $timestamps = false; |
| 20 | |
| 21 | protected $casts = [ |
| 22 | 'ID' => 'integer', |
| 23 | ]; |
| 24 | |
| 25 | public function meta() |
| 26 | { |
| 27 | return $this->has_many(UserMetaModel::class, 'user_id', 'ID'); |
| 28 | } |
| 29 | } |
| 30 |