1: <?php
2:
3: /**
4: * Orchestra: A minimalist object-oriented superset for WordPress using Phalcon.
5: *
6: * This source file is subject to the MIT license that is bundled
7: * with this package in the file LICENSE and is available through
8: * the world-wide-web at the following URI:
9: * http://opensource.org/licenses/MIT
10: *
11: * @copyright Akufen Atelier Creatif
12: * @author Nicholas Charbonneau <nicholas@akufen.ca>
13: * @license http://opensource.org/licenses/MIT
14: * @version 0.1.3
15: * @link https://github.com/akufenstudio/orchestra
16: */
17:
18: namespace Akufen\Orchestra\Mvc\Models;
19:
20: /**
21: * Akufen\Orchestra\Mvc\Models\UserMeta
22: *
23: * A model for WordPress user's metas.
24: *
25: * @package Models
26: * @uses \Akufen\Orchestra\Mvc\Model
27: */
28: class UserMeta extends \Akufen\Orchestra\Mvc\Model
29: {
30: /**
31: * Initialize a user's meta source & relationships.
32: *
33: * @return void
34: */
35: public function initialize()
36: {
37: global $table_prefix;
38:
39: $this->setSource($table_prefix . 'usermeta');
40:
41: // User metas belong to a user
42: $this->belongsTo(
43: 'user_id',
44: 'Akufen\Orchestra\Mvc\Models\Users',
45: 'ID',
46: array('alias' => 'user')
47: );
48: }
49: }
50: