コード例 #1
0
ファイル: APICallRepository.php プロジェクト: CryptArc/xchain
 public function create($attributes)
 {
     if (!isset($attributes['user_id']) or !$attributes['user_id']) {
         throw new Exception("User ID is required", 1);
     }
     return parent::create($attributes);
 }
コード例 #2
0
ファイル: AccountRepository.php プロジェクト: CryptArc/xchain
 public function update(Model $model, $attributes)
 {
     if ($model['name'] == 'default') {
         throw new Exception("The default account may not be updated.", 400);
     }
     return parent::update($model, $attributes);
 }
コード例 #3
0
 public function create($attributes)
 {
     if (!isset($attributes['account_id']) or !$attributes['account_id']) {
         throw new Exception("Account ID is required", 1);
     }
     if (!isset($attributes['direction']) or !is_numeric($attributes['direction'])) {
         throw new Exception("direction is required", 1);
     }
     // require either an api call or a transaction
     if ((!isset($attributes['api_call_id']) or !$attributes['api_call_id']) and (!isset($attributes['txid']) or !$attributes['txid'])) {
         throw new Exception("API Call ID or Transaction ID is required", 1);
     }
     if (!isset($attributes['type']) or !$attributes['type']) {
         throw new Exception("Type is required", 1);
     }
     return parent::create($attributes);
 }