public function depots() { return $this->hasMany(get_namespace($this) . '\\WechatDepot', 'waid', 'id'); }
public function depot() { return $this->belongsTo(get_namespace($this) . '\\WechatDepot', 'wdid', 'id'); }
public function subscribe_depot() { return $this->hasOne(get_namespace($this) . '\\WechatDepot', 'id', 'subscribe_wdid'); }
public function finance() { return $this->hasOne(get_namespace($this) . '\\UserFinance', 'id', 'id'); }
public function activity_type() { return $this->hasOne(get_namespace($this) . '\\ActivityType', 'id', 'type_id'); }
public function callback() { return $this->hasOne(get_namespace($this) . '\\WechatDepotCallback', 'id', 'id'); }
public function message() { return $this->hasOne(get_namespace($this) . '\\WechatMessage', 'id', 'id'); }
public function depots() { return $this->belongsToMany(get_namespace($this) . '\\WechatDepot', 'wechat_reply_depot', 'wrid', 'wdid'); }
public function activity() { return $this->hasMany(get_namespace($this) . '\\Activity', 'type_id', 'id'); }
private function getModel($name) { return get_namespace($this) . '\\' . ucfirst(get_model_class($name)); }
public function testGetNamespace() { $expectations = [[null, ''], ['', ''], ['Strings', ''], ['\\Packaged\\Helpers\\Strings', '\\Packaged\\Helpers'], [new \Packaged\Helpers\Strings(), '\\Packaged\\Helpers']]; foreach ($expectations as $expect) { $this->assertEquals($expect[1], get_namespace($expect[0])); } }
public function user() { return $this->hasOne(get_namespace($this) . '\\User', 'id', 'id'); }
/** * @covers \get_namespace * @covers ::from * @dataProvider provideDataToTest */ public function testCanCallAsFunction($data, $expectedNamespace) { // ---------------------------------------------------------------- // setup your test // ---------------------------------------------------------------- // perform the change $actualNamespace = get_namespace($data); // ---------------------------------------------------------------- // test the results $this->assertEquals($expectedNamespace, $actualNamespace); }
public function account() { return $this->hasOne(get_namespace($this) . '\\WechatAccount', 'id', 'waid'); }
function histories() { return $this->hasMany(get_namespace($this) . '\\ManualHistory', 'mid', 'id'); }
public function file() { return $this->hasOne(get_namespace($this) . '\\AttachmentFile', 'id', 'afid'); }
public function depots() { return $this->belongsToMany(get_namespace($this) . '\\WechatDepot', 'wechat_depot_news_relation', 'wnid', 'wdid'); }