コード例 #1
0
ファイル: WechatAccount.php プロジェクト: unionbt/hanpaimall
 public function depots()
 {
     return $this->hasMany(get_namespace($this) . '\\WechatDepot', 'waid', 'id');
 }
コード例 #2
0
 public function depot()
 {
     return $this->belongsTo(get_namespace($this) . '\\WechatDepot', 'wdid', 'id');
 }
コード例 #3
0
ファイル: WechatQrcode.php プロジェクト: unionbt/hanpaimall
 public function subscribe_depot()
 {
     return $this->hasOne(get_namespace($this) . '\\WechatDepot', 'id', 'subscribe_wdid');
 }
コード例 #4
0
ファイル: User.php プロジェクト: unionbt/hanpaimall
 public function finance()
 {
     return $this->hasOne(get_namespace($this) . '\\UserFinance', 'id', 'id');
 }
コード例 #5
0
ファイル: Activity.php プロジェクト: unionbt/hanpaimall
 public function activity_type()
 {
     return $this->hasOne(get_namespace($this) . '\\ActivityType', 'id', 'type_id');
 }
コード例 #6
0
ファイル: WechatDepot.php プロジェクト: unionbt/hanpaimall
 public function callback()
 {
     return $this->hasOne(get_namespace($this) . '\\WechatDepotCallback', 'id', 'id');
 }
コード例 #7
0
 public function message()
 {
     return $this->hasOne(get_namespace($this) . '\\WechatMessage', 'id', 'id');
 }
コード例 #8
0
ファイル: WechatReply.php プロジェクト: unionbt/hanpaimall
 public function depots()
 {
     return $this->belongsToMany(get_namespace($this) . '\\WechatDepot', 'wechat_reply_depot', 'wrid', 'wdid');
 }
コード例 #9
0
ファイル: ActivityType.php プロジェクト: unionbt/hanpaimall
 public function activity()
 {
     return $this->hasMany(get_namespace($this) . '\\Activity', 'type_id', 'id');
 }
コード例 #10
0
ファイル: Controller.php プロジェクト: laracrud/laracrud
 private function getModel($name)
 {
     return get_namespace($this) . '\\' . ucfirst(get_model_class($name));
 }
コード例 #11
0
 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]));
     }
 }
コード例 #12
0
ファイル: UserFinance.php プロジェクト: unionbt/hanpaimall
 public function user()
 {
     return $this->hasOne(get_namespace($this) . '\\User', 'id', 'id');
 }
コード例 #13
0
 /**
  * @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);
 }
コード例 #14
0
ファイル: WechatLog.php プロジェクト: unionbt/hanpaimall
 public function account()
 {
     return $this->hasOne(get_namespace($this) . '\\WechatAccount', 'id', 'waid');
 }
コード例 #15
0
ファイル: Manual.php プロジェクト: unionbt/hanpaimall
 function histories()
 {
     return $this->hasMany(get_namespace($this) . '\\ManualHistory', 'mid', 'id');
 }
コード例 #16
0
ファイル: Attachment.php プロジェクト: unionbt/hanpaimall
 public function file()
 {
     return $this->hasOne(get_namespace($this) . '\\AttachmentFile', 'id', 'afid');
 }
コード例 #17
0
 public function depots()
 {
     return $this->belongsToMany(get_namespace($this) . '\\WechatDepot', 'wechat_depot_news_relation', 'wnid', 'wdid');
 }