public function post($ref = false) { if ($ref) { $this->primaryKey = 'meta_value'; return $this->hasOne('Corcel\\Post', 'ID'); } return $this->belongsTo('Corcel\\Post'); }